crossbeam-utils/src/thread.rs
Line | Count | Source (jump to first uncovered line) |
1 | | //! Threads that can borrow variables from the stack. |
2 | | //! |
3 | | //! Create a scope when spawned threads need to access variables on the stack: |
4 | | //! |
5 | | //! ``` |
6 | | //! use crossbeam_utils::thread; |
7 | | //! |
8 | | //! let people = vec![ |
9 | | //! "Alice".to_string(), |
10 | | //! "Bob".to_string(), |
11 | | //! "Carol".to_string(), |
12 | | //! ]; |
13 | | //! |
14 | | //! thread::scope(|s| { |
15 | | //! for person in &people { |
16 | | //! s.spawn(move |_| { |
17 | | //! println!("Hello, {}!", person); |
18 | | //! }); |
19 | | //! } |
20 | | //! }).unwrap(); |
21 | | //! ``` |
22 | | //! |
23 | | //! # Why scoped threads? |
24 | | //! |
25 | | //! Suppose we wanted to re-write the previous example using plain threads: |
26 | | //! |
27 | | //! ```compile_fail,E0597 |
28 | | //! use std::thread; |
29 | | //! |
30 | | //! let people = vec![ |
31 | | //! "Alice".to_string(), |
32 | | //! "Bob".to_string(), |
33 | | //! "Carol".to_string(), |
34 | | //! ]; |
35 | | //! |
36 | | //! let mut threads = Vec::new(); |
37 | | //! |
38 | | //! for person in &people { |
39 | | //! threads.push(thread::spawn(move || { |
40 | | //! println!("Hello, {}!", person); |
41 | | //! })); |
42 | | //! } |
43 | | //! |
44 | | //! for thread in threads { |
45 | | //! thread.join().unwrap(); |
46 | | //! } |
47 | | //! ``` |
48 | | //! |
49 | | //! This doesn't work because the borrow checker complains about `people` not living long enough: |
50 | | //! |
51 | | //! ```text |
52 | | //! error[E0597]: `people` does not live long enough |
53 | | //! --> src/main.rs:12:20 |
54 | | //! | |
55 | | //! 12 | for person in &people { |
56 | | //! | ^^^^^^ borrowed value does not live long enough |
57 | | //! ... |
58 | | //! 21 | } |
59 | | //! | - borrowed value only lives until here |
60 | | //! | |
61 | | //! = note: borrowed value must be valid for the static lifetime... |
62 | | //! ``` |
63 | | //! |
64 | | //! The problem here is that spawned threads are not allowed to borrow variables on stack because |
65 | | //! the compiler cannot prove they will be joined before `people` is destroyed. |
66 | | //! |
67 | | //! Scoped threads are a mechanism to guarantee to the compiler that spawned threads will be joined |
68 | | //! before the scope ends. |
69 | | //! |
70 | | //! # How scoped threads work |
71 | | //! |
72 | | //! If a variable is borrowed by a thread, the thread must complete before the variable is |
73 | | //! destroyed. Threads spawned using [`std::thread::spawn`] can only borrow variables with the |
74 | | //! `'static` lifetime because the borrow checker cannot be sure when the thread will complete. |
75 | | //! |
76 | | //! A scope creates a clear boundary between variables outside the scope and threads inside the |
77 | | //! scope. Whenever a scope spawns a thread, it promises to join the thread before the scope ends. |
78 | | //! This way we guarantee to the borrow checker that scoped threads only live within the scope and |
79 | | //! can safely access variables outside it. |
80 | | //! |
81 | | //! # Nesting scoped threads |
82 | | //! |
83 | | //! Sometimes scoped threads need to spawn more threads within the same scope. This is a little |
84 | | //! tricky because argument `s` lives *inside* the invocation of `thread::scope()` and as such |
85 | | //! cannot be borrowed by scoped threads: |
86 | | //! |
87 | | //! ```compile_fail,E0373,E0521 |
88 | | //! use crossbeam_utils::thread; |
89 | | //! |
90 | | //! thread::scope(|s| { |
91 | | //! s.spawn(|_| { |
92 | | //! // Not going to compile because we're trying to borrow `s`, |
93 | | //! // which lives *inside* the scope! :( |
94 | | //! s.spawn(|_| println!("nested thread")); |
95 | | //! }); |
96 | | //! }); |
97 | | //! ``` |
98 | | //! |
99 | | //! Fortunately, there is a solution. Every scoped thread is passed a reference to its scope as an |
100 | | //! argument, which can be used for spawning nested threads: |
101 | | //! |
102 | | //! ``` |
103 | | //! use crossbeam_utils::thread; |
104 | | //! |
105 | | //! thread::scope(|s| { |
106 | | //! // Note the `|s|` here. |
107 | | //! s.spawn(|s| { |
108 | | //! // Yay, this works because we're using a fresh argument `s`! :) |
109 | | //! s.spawn(|_| println!("nested thread")); |
110 | | //! }); |
111 | | //! }).unwrap(); |
112 | | //! ``` |
113 | | |
114 | | use std::fmt; |
115 | | use std::io; |
116 | | use std::marker::PhantomData; |
117 | | use std::mem; |
118 | | use std::panic; |
119 | | use std::sync::{Arc, Mutex}; |
120 | | use std::thread; |
121 | | |
122 | | use crate::sync::WaitGroup; |
123 | | use cfg_if::cfg_if; |
124 | | |
125 | | type SharedVec<T> = Arc<Mutex<Vec<T>>>; |
126 | | type SharedOption<T> = Arc<Mutex<Option<T>>>; |
127 | | |
128 | | /// Creates a new scope for spawning threads. |
129 | | /// |
130 | | /// All child threads that haven't been manually joined will be automatically joined just before |
131 | | /// this function invocation ends. If all joined threads have successfully completed, `Ok` is |
132 | | /// returned with the return value of `f`. If any of the joined threads has panicked, an `Err` is |
133 | | /// returned containing errors from panicked threads. |
134 | | /// |
135 | | /// # Examples |
136 | | /// |
137 | | /// ``` |
138 | | /// use crossbeam_utils::thread; |
139 | | /// |
140 | | /// let var = vec![1, 2, 3]; |
141 | | /// |
142 | | /// thread::scope(|s| { |
143 | | /// s.spawn(|_| { |
144 | | /// println!("A child thread borrowing `var`: {:?}", var); |
145 | | /// }); |
146 | | /// }).unwrap(); |
147 | | /// ``` |
148 | 31.7k | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> |
149 | 31.7k | where |
150 | 31.7k | F: FnOnce(&Scope<'env>) -> R, |
151 | 31.7k | { |
152 | 31.7k | let wg = WaitGroup::new(); |
153 | 31.7k | let scope = Scope::<'env> { |
154 | 31.7k | handles: SharedVec::default(), |
155 | 31.7k | wait_group: wg.clone(), |
156 | 31.7k | _marker: PhantomData, |
157 | 31.7k | }; |
158 | 31.7k | |
159 | 31.7k | // Execute the scoped function, but catch any panics. |
160 | 31.7k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); crossbeam_utils::thread::scope::<injector::destructors::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<injector::stress::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<injector::stampede::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<injector::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<injector::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<injector::no_starvation::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::recv_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_sender::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::fairness_duplicates::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::stress_oneshot::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::try_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::recv_in_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::len_empty_full::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::stress_iter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_receiver::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::send_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::len::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::try_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::fairness::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<zero::drops::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<seg_queue::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<seg_queue::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<seg_queue::drops::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::unblocks::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::matching::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::cloning1::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::disconnected::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::timeout::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::fairness2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::linearizable_try::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::matching_with_leftover::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::sync_and_clone::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::cloning2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::stress_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::stress_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::unblocks::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::both_ready::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::disconnected::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::stress_mixed::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::reuse::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::send_and_clone::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::loop_try::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 20 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select::linearizable_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<after::recv_two::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<after::stress_clone::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1.00k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<after::ready::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<after::select::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::linearizable::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::send_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::try_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::stress_iter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::recv_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::len::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::stress_oneshot::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::drops::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::try_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::disconnect_wakes_receiver::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::disconnect_wakes_sender::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<iter::recv_iter_break::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<iter::recv_try_iter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<iter::nested_recv_iter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<tick::recv_two::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<tick::select::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<tick::ready::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array_queue::len::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array_queue::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array_queue::drops::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array_queue::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<array_queue::linearizable::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<fifo::destructors::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<fifo::stress::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<fifo::no_starvation::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<fifo::stampede::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<fifo::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::stress_iter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::linearizable::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::drops::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::mpmc::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::stress_oneshot::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::try_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::recv_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::disconnect_wakes_receiver::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<list::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::stress_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::linearizable_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_sender::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_receiver::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::cloning1::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::recv_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::try_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::linearizable_default::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::try_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::fairness2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::both_ready::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::matching::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::loop_try::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 20 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::cloning2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::matching_with_leftover::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::send_timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::stress_mixed::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::stress_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::cloning1::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::timeout::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::timeout::{closure#1}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::fairness2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::stress_timeout_two_threads::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::both_ready::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::stress_recv::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::stress_send::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::cloning2::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::channel_through_channel::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<ready::stress_mixed::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<parker::park_timeout_unpark_called_other_thread::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 10 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<lifo::stampede::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<lifo::spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<lifo::destructors::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<lifo::stress::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<lifo::no_starvation::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::nesting::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::join::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::join_nested::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::panic_many::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::counter::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::counter_panic::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::as_pthread_t::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::counter_builder::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::panic_twice::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<thread::scope_returns_ok::{closure#0}, i32>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::stress::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}, ()>::{closure#0}Line | Count | Source | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); |
|
161 | 31.7k | |
162 | 31.7k | // Wait until all nested scopes are dropped. |
163 | 31.7k | drop(scope.wait_group); |
164 | 31.7k | wg.wait(); |
165 | 31.7k | |
166 | 31.7k | // Join all remaining spawned threads. |
167 | 31.7k | let panics: Vec<_> = scope |
168 | 31.7k | .handles |
169 | 31.7k | .lock() |
170 | 31.7k | .unwrap() |
171 | 31.7k | // Filter handles that haven't been joined, join them, and collect errors. |
172 | 31.7k | .drain(..) |
173 | 71.8k | .filter_map(|handle| handle.lock().unwrap().take()) crossbeam_utils::thread::scope::<injector::destructors::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<injector::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<injector::no_starvation::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<injector::stress::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<injector::stampede::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<injector::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::len::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_sender::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::try_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::stress_oneshot::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 20.0k | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::recv_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::fairness_duplicates::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::drops::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 200 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::send_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::recv_in_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::try_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::len_empty_full::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::fairness::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::stress_iter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_receiver::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<seg_queue::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<seg_queue::drops::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 200 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<seg_queue::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::unblocks::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::stress_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::stress_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::unblocks::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::matching::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 44 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::linearizable_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::both_ready::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::disconnected::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::sync_and_clone::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 20 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::timeout::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::cloning1::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::send_and_clone::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 20 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::loop_try::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 60 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::stress_mixed::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::reuse::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 6 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::linearizable_try::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::matching_with_leftover::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 55 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::disconnected::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::cloning2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select::fairness2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<after::recv_two::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<after::select::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<after::stress_clone::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 10.0k | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<after::ready::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::stress_iter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::linearizable::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::send_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::disconnect_wakes_receiver::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::disconnect_wakes_sender::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::recv_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::len::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::stress_oneshot::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 20.0k | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::drops::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 200 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::try_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array::try_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<iter::nested_recv_iter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<iter::recv_try_iter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<iter::recv_iter_break::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<tick::select::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<tick::recv_two::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<tick::ready::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array_queue::drops::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 200 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array_queue::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array_queue::len::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array_queue::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<array_queue::linearizable::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<fifo::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<fifo::destructors::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<fifo::stress::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<fifo::stampede::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<fifo::no_starvation::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::recv_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::drops::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 200 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::mpmc::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::stress_iter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::linearizable::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::disconnect_wakes_receiver::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::try_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<list::stress_oneshot::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 20.0k | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::stress_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::linearizable_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::cloning1::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_sender::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::stress_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_receiver::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 6 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::loop_try::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 60 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::fairness2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::recv_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::both_ready::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::try_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::linearizable_default::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::send_timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::stress_mixed::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::try_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::matching::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 44 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::cloning2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::matching_with_leftover::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 55 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::stress_timeout_two_threads::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::stress_send::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::timeout::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::timeout::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::channel_through_channel::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 6 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::cloning2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::stress_mixed::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::stress_recv::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::cloning1::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::both_ready::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#1}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<ready::fairness2::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<parker::park_timeout_unpark_called_other_thread::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 10 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<lifo::destructors::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<lifo::stress::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<lifo::stampede::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<lifo::no_starvation::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<lifo::spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::counter::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 10 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::as_pthread_t::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::panic_many::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 3 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::nesting::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 7 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::counter_builder::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 10 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::join_nested::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::join::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::scope_returns_ok::{closure#0}, i32>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::panic_twice::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<thread::counter_panic::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 11 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 4 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 6 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::stress::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 8 | .filter_map(|handle| handle.lock().unwrap().take()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}, ()>::{closure#1}Line | Count | Source | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) |
|
174 | 71.8k | .filter_map(|handle| handle.join().err()) crossbeam_utils::thread::scope::<injector::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<injector::stampede::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<injector::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<injector::destructors::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<injector::stress::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<injector::no_starvation::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::stress_iter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_receiver::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::stress_oneshot::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 20.0k | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::try_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::recv_in_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::drops::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 200 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::len::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::recv_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::send_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::try_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_sender::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::len_empty_full::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::fairness::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<zero::fairness_duplicates::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<seg_queue::drops::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 200 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<seg_queue::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<seg_queue::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::both_ready::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::disconnected::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::fairness2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::cloning2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 6 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::unblocks::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::linearizable_try::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::matching_with_leftover::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 55 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::sync_and_clone::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 20 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::stress_mixed::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::reuse::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::send_and_clone::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 20 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::cloning1::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::loop_try::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 60 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::timeout::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::linearizable_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::disconnected::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::matching::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 44 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::stress_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::stress_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select::unblocks::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<after::stress_clone::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 10.0k | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<after::ready::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<after::recv_two::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<after::select::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::linearizable::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::stress_oneshot::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 20.0k | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::drops::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 200 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::len::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::try_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::disconnect_wakes_sender::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::send_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::recv_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::try_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::stress_iter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::disconnect_wakes_receiver::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<iter::recv_iter_break::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<iter::nested_recv_iter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<iter::recv_try_iter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<tick::recv_two::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<tick::select::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<tick::ready::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array_queue::linearizable::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array_queue::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array_queue::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array_queue::len::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<array_queue::drops::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 200 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<fifo::destructors::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<fifo::stress::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<fifo::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<fifo::stampede::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<fifo::no_starvation::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::try_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::stress_iter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::linearizable::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::stress_oneshot::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 20.0k | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::disconnect_wakes_receiver::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::recv_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::mpmc::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<list::drops::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 200 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::linearizable_default::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 6 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::loop_try::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 60 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::matching_with_leftover::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 55 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::stress_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::linearizable_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::send_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::stress_mixed::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::recv_timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::matching::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 44 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::fairness2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::cloning2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::try_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_sender::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_receiver::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::cloning1::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::both_ready::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::try_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<select_macro::stress_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::stress_send::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::cloning1::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::fairness2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::both_ready::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::stress_mixed::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::timeout::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::timeout::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::cloning2::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#1}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::stress_recv::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::stress_timeout_two_threads::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::channel_through_channel::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 6 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<parker::park_timeout_unpark_called_other_thread::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 10 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<lifo::destructors::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<lifo::stress::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<lifo::spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<lifo::stampede::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<lifo::no_starvation::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::panic_twice::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 2 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::counter_panic::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 11 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::join_nested::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::counter::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 10 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::panic_many::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 3 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::nesting::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 7 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<thread::counter_builder::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 10 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 4 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 1 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 6 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::stress::{closure#0}, ()>::{closure#2}Line | Count | Source | 174 | 8 | .filter_map(|handle| handle.join().err()) |
|
175 | 31.7k | .collect(); |
176 | 31.7k | |
177 | 31.7k | // If `f` has panicked, resume unwinding. |
178 | 31.7k | // If any of the child threads have panicked, return the panic errors. |
179 | 31.7k | // Otherwise, everything is OK and return the result of `f`. |
180 | 31.7k | match result { |
181 | 0 | Err(err) => panic::resume_unwind(err), |
182 | 31.7k | Ok(res) => { |
183 | 31.7k | if panics.is_empty() { |
184 | 31.7k | Ok(res) |
185 | | } else { |
186 | 3 | Err(Box::new(panics)) |
187 | | } |
188 | | } |
189 | | } |
190 | 31.7k | } crossbeam_utils::thread::scope::<injector::destructors::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<injector::stress::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<injector::stampede::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<injector::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<injector::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<injector::no_starvation::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::len::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_sender::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::stress_iter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::fairness_duplicates::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::disconnect_wakes_receiver::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::len_empty_full::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::drops::{closure#0}, ()>Line | Count | Source | 148 | 100 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 100 | where | 150 | 100 | F: FnOnce(&Scope<'env>) -> R, | 151 | 100 | { | 152 | 100 | let wg = WaitGroup::new(); | 153 | 100 | let scope = Scope::<'env> { | 154 | 100 | handles: SharedVec::default(), | 155 | 100 | wait_group: wg.clone(), | 156 | 100 | _marker: PhantomData, | 157 | 100 | }; | 158 | 100 | | 159 | 100 | // Execute the scoped function, but catch any panics. | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 100 | | 162 | 100 | // Wait until all nested scopes are dropped. | 163 | 100 | drop(scope.wait_group); | 164 | 100 | wg.wait(); | 165 | 100 | | 166 | 100 | // Join all remaining spawned threads. | 167 | 100 | let panics: Vec<_> = scope | 168 | 100 | .handles | 169 | 100 | .lock() | 170 | 100 | .unwrap() | 171 | 100 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 100 | .drain(..) | 173 | 100 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 100 | .filter_map(|handle| handle.join().err()) | 175 | 100 | .collect(); | 176 | 100 | | 177 | 100 | // If `f` has panicked, resume unwinding. | 178 | 100 | // If any of the child threads have panicked, return the panic errors. | 179 | 100 | // Otherwise, everything is OK and return the result of `f`. | 180 | 100 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 100 | Ok(res) => { | 183 | 100 | if panics.is_empty() { | 184 | 100 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 100 | } |
crossbeam_utils::thread::scope::<zero::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::send_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::fairness::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::stress_oneshot::{closure#0}, ()>Line | Count | Source | 148 | 10.0k | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 10.0k | where | 150 | 10.0k | F: FnOnce(&Scope<'env>) -> R, | 151 | 10.0k | { | 152 | 10.0k | let wg = WaitGroup::new(); | 153 | 10.0k | let scope = Scope::<'env> { | 154 | 10.0k | handles: SharedVec::default(), | 155 | 10.0k | wait_group: wg.clone(), | 156 | 10.0k | _marker: PhantomData, | 157 | 10.0k | }; | 158 | 10.0k | | 159 | 10.0k | // Execute the scoped function, but catch any panics. | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 10.0k | | 162 | 10.0k | // Wait until all nested scopes are dropped. | 163 | 10.0k | drop(scope.wait_group); | 164 | 10.0k | wg.wait(); | 165 | 10.0k | | 166 | 10.0k | // Join all remaining spawned threads. | 167 | 10.0k | let panics: Vec<_> = scope | 168 | 10.0k | .handles | 169 | 10.0k | .lock() | 170 | 10.0k | .unwrap() | 171 | 10.0k | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 10.0k | .drain(..) | 173 | 10.0k | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 10.0k | .filter_map(|handle| handle.join().err()) | 175 | 10.0k | .collect(); | 176 | 10.0k | | 177 | 10.0k | // If `f` has panicked, resume unwinding. | 178 | 10.0k | // If any of the child threads have panicked, return the panic errors. | 179 | 10.0k | // Otherwise, everything is OK and return the result of `f`. | 180 | 10.0k | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 10.0k | Ok(res) => { | 183 | 10.0k | if panics.is_empty() { | 184 | 10.0k | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 10.0k | } |
crossbeam_utils::thread::scope::<zero::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::try_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::recv_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::try_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<zero::recv_in_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<seg_queue::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<seg_queue::drops::{closure#0}, ()>Line | Count | Source | 148 | 100 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 100 | where | 150 | 100 | F: FnOnce(&Scope<'env>) -> R, | 151 | 100 | { | 152 | 100 | let wg = WaitGroup::new(); | 153 | 100 | let scope = Scope::<'env> { | 154 | 100 | handles: SharedVec::default(), | 155 | 100 | wait_group: wg.clone(), | 156 | 100 | _marker: PhantomData, | 157 | 100 | }; | 158 | 100 | | 159 | 100 | // Execute the scoped function, but catch any panics. | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 100 | | 162 | 100 | // Wait until all nested scopes are dropped. | 163 | 100 | drop(scope.wait_group); | 164 | 100 | wg.wait(); | 165 | 100 | | 166 | 100 | // Join all remaining spawned threads. | 167 | 100 | let panics: Vec<_> = scope | 168 | 100 | .handles | 169 | 100 | .lock() | 170 | 100 | .unwrap() | 171 | 100 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 100 | .drain(..) | 173 | 100 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 100 | .filter_map(|handle| handle.join().err()) | 175 | 100 | .collect(); | 176 | 100 | | 177 | 100 | // If `f` has panicked, resume unwinding. | 178 | 100 | // If any of the child threads have panicked, return the panic errors. | 179 | 100 | // Otherwise, everything is OK and return the result of `f`. | 180 | 100 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 100 | Ok(res) => { | 183 | 100 | if panics.is_empty() { | 184 | 100 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 100 | } |
crossbeam_utils::thread::scope::<seg_queue::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::disconnected::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::stress_mixed::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::cloning2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::stress_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::linearizable_try::{closure#0}, ()>Line | Count | Source | 148 | 2 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 2 | where | 150 | 2 | F: FnOnce(&Scope<'env>) -> R, | 151 | 2 | { | 152 | 2 | let wg = WaitGroup::new(); | 153 | 2 | let scope = Scope::<'env> { | 154 | 2 | handles: SharedVec::default(), | 155 | 2 | wait_group: wg.clone(), | 156 | 2 | _marker: PhantomData, | 157 | 2 | }; | 158 | 2 | | 159 | 2 | // Execute the scoped function, but catch any panics. | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 2 | | 162 | 2 | // Wait until all nested scopes are dropped. | 163 | 2 | drop(scope.wait_group); | 164 | 2 | wg.wait(); | 165 | 2 | | 166 | 2 | // Join all remaining spawned threads. | 167 | 2 | let panics: Vec<_> = scope | 168 | 2 | .handles | 169 | 2 | .lock() | 170 | 2 | .unwrap() | 171 | 2 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 2 | .drain(..) | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 2 | .filter_map(|handle| handle.join().err()) | 175 | 2 | .collect(); | 176 | 2 | | 177 | 2 | // If `f` has panicked, resume unwinding. | 178 | 2 | // If any of the child threads have panicked, return the panic errors. | 179 | 2 | // Otherwise, everything is OK and return the result of `f`. | 180 | 2 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 2 | Ok(res) => { | 183 | 2 | if panics.is_empty() { | 184 | 2 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 2 | } |
crossbeam_utils::thread::scope::<select::disconnected::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::matching_with_leftover::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::cloning1::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 3 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 3 | where | 150 | 3 | F: FnOnce(&Scope<'env>) -> R, | 151 | 3 | { | 152 | 3 | let wg = WaitGroup::new(); | 153 | 3 | let scope = Scope::<'env> { | 154 | 3 | handles: SharedVec::default(), | 155 | 3 | wait_group: wg.clone(), | 156 | 3 | _marker: PhantomData, | 157 | 3 | }; | 158 | 3 | | 159 | 3 | // Execute the scoped function, but catch any panics. | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 3 | | 162 | 3 | // Wait until all nested scopes are dropped. | 163 | 3 | drop(scope.wait_group); | 164 | 3 | wg.wait(); | 165 | 3 | | 166 | 3 | // Join all remaining spawned threads. | 167 | 3 | let panics: Vec<_> = scope | 168 | 3 | .handles | 169 | 3 | .lock() | 170 | 3 | .unwrap() | 171 | 3 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 3 | .drain(..) | 173 | 3 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 3 | .filter_map(|handle| handle.join().err()) | 175 | 3 | .collect(); | 176 | 3 | | 177 | 3 | // If `f` has panicked, resume unwinding. | 178 | 3 | // If any of the child threads have panicked, return the panic errors. | 179 | 3 | // Otherwise, everything is OK and return the result of `f`. | 180 | 3 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 3 | Ok(res) => { | 183 | 3 | if panics.is_empty() { | 184 | 3 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 3 | } |
crossbeam_utils::thread::scope::<select::timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::timeout::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::matching::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::stress_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::sync_and_clone::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::linearizable_timeout::{closure#0}, ()>Line | Count | Source | 148 | 2 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 2 | where | 150 | 2 | F: FnOnce(&Scope<'env>) -> R, | 151 | 2 | { | 152 | 2 | let wg = WaitGroup::new(); | 153 | 2 | let scope = Scope::<'env> { | 154 | 2 | handles: SharedVec::default(), | 155 | 2 | wait_group: wg.clone(), | 156 | 2 | _marker: PhantomData, | 157 | 2 | }; | 158 | 2 | | 159 | 2 | // Execute the scoped function, but catch any panics. | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 2 | | 162 | 2 | // Wait until all nested scopes are dropped. | 163 | 2 | drop(scope.wait_group); | 164 | 2 | wg.wait(); | 165 | 2 | | 166 | 2 | // Join all remaining spawned threads. | 167 | 2 | let panics: Vec<_> = scope | 168 | 2 | .handles | 169 | 2 | .lock() | 170 | 2 | .unwrap() | 171 | 2 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 2 | .drain(..) | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 2 | .filter_map(|handle| handle.join().err()) | 175 | 2 | .collect(); | 176 | 2 | | 177 | 2 | // If `f` has panicked, resume unwinding. | 178 | 2 | // If any of the child threads have panicked, return the panic errors. | 179 | 2 | // Otherwise, everything is OK and return the result of `f`. | 180 | 2 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 2 | Ok(res) => { | 183 | 2 | if panics.is_empty() { | 184 | 2 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 2 | } |
crossbeam_utils::thread::scope::<select::send_and_clone::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::unblocks::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::reuse::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::unblocks::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::loop_try::{closure#0}, ()>Line | Count | Source | 148 | 20 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 20 | where | 150 | 20 | F: FnOnce(&Scope<'env>) -> R, | 151 | 20 | { | 152 | 20 | let wg = WaitGroup::new(); | 153 | 20 | let scope = Scope::<'env> { | 154 | 20 | handles: SharedVec::default(), | 155 | 20 | wait_group: wg.clone(), | 156 | 20 | _marker: PhantomData, | 157 | 20 | }; | 158 | 20 | | 159 | 20 | // Execute the scoped function, but catch any panics. | 160 | 20 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 20 | | 162 | 20 | // Wait until all nested scopes are dropped. | 163 | 20 | drop(scope.wait_group); | 164 | 20 | wg.wait(); | 165 | 20 | | 166 | 20 | // Join all remaining spawned threads. | 167 | 20 | let panics: Vec<_> = scope | 168 | 20 | .handles | 169 | 20 | .lock() | 170 | 20 | .unwrap() | 171 | 20 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 20 | .drain(..) | 173 | 20 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 20 | .filter_map(|handle| handle.join().err()) | 175 | 20 | .collect(); | 176 | 20 | | 177 | 20 | // If `f` has panicked, resume unwinding. | 178 | 20 | // If any of the child threads have panicked, return the panic errors. | 179 | 20 | // Otherwise, everything is OK and return the result of `f`. | 180 | 20 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 20 | Ok(res) => { | 183 | 20 | if panics.is_empty() { | 184 | 20 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 20 | } |
crossbeam_utils::thread::scope::<select::fairness2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select::both_ready::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<after::ready::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<after::select::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<after::stress_clone::{closure#0}, ()>Line | Count | Source | 148 | 1.00k | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1.00k | where | 150 | 1.00k | F: FnOnce(&Scope<'env>) -> R, | 151 | 1.00k | { | 152 | 1.00k | let wg = WaitGroup::new(); | 153 | 1.00k | let scope = Scope::<'env> { | 154 | 1.00k | handles: SharedVec::default(), | 155 | 1.00k | wait_group: wg.clone(), | 156 | 1.00k | _marker: PhantomData, | 157 | 1.00k | }; | 158 | 1.00k | | 159 | 1.00k | // Execute the scoped function, but catch any panics. | 160 | 1.00k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1.00k | | 162 | 1.00k | // Wait until all nested scopes are dropped. | 163 | 1.00k | drop(scope.wait_group); | 164 | 1.00k | wg.wait(); | 165 | 1.00k | | 166 | 1.00k | // Join all remaining spawned threads. | 167 | 1.00k | let panics: Vec<_> = scope | 168 | 1.00k | .handles | 169 | 1.00k | .lock() | 170 | 1.00k | .unwrap() | 171 | 1.00k | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1.00k | .drain(..) | 173 | 1.00k | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1.00k | .filter_map(|handle| handle.join().err()) | 175 | 1.00k | .collect(); | 176 | 1.00k | | 177 | 1.00k | // If `f` has panicked, resume unwinding. | 178 | 1.00k | // If any of the child threads have panicked, return the panic errors. | 179 | 1.00k | // Otherwise, everything is OK and return the result of `f`. | 180 | 1.00k | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1.00k | Ok(res) => { | 183 | 1.00k | if panics.is_empty() { | 184 | 1.00k | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1.00k | } |
crossbeam_utils::thread::scope::<after::recv_two::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::disconnect_wakes_sender::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::disconnect_wakes_receiver::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::len::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::stress_oneshot::{closure#0}, ()>Line | Count | Source | 148 | 10.0k | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 10.0k | where | 150 | 10.0k | F: FnOnce(&Scope<'env>) -> R, | 151 | 10.0k | { | 152 | 10.0k | let wg = WaitGroup::new(); | 153 | 10.0k | let scope = Scope::<'env> { | 154 | 10.0k | handles: SharedVec::default(), | 155 | 10.0k | wait_group: wg.clone(), | 156 | 10.0k | _marker: PhantomData, | 157 | 10.0k | }; | 158 | 10.0k | | 159 | 10.0k | // Execute the scoped function, but catch any panics. | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 10.0k | | 162 | 10.0k | // Wait until all nested scopes are dropped. | 163 | 10.0k | drop(scope.wait_group); | 164 | 10.0k | wg.wait(); | 165 | 10.0k | | 166 | 10.0k | // Join all remaining spawned threads. | 167 | 10.0k | let panics: Vec<_> = scope | 168 | 10.0k | .handles | 169 | 10.0k | .lock() | 170 | 10.0k | .unwrap() | 171 | 10.0k | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 10.0k | .drain(..) | 173 | 10.0k | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 10.0k | .filter_map(|handle| handle.join().err()) | 175 | 10.0k | .collect(); | 176 | 10.0k | | 177 | 10.0k | // If `f` has panicked, resume unwinding. | 178 | 10.0k | // If any of the child threads have panicked, return the panic errors. | 179 | 10.0k | // Otherwise, everything is OK and return the result of `f`. | 180 | 10.0k | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 10.0k | Ok(res) => { | 183 | 10.0k | if panics.is_empty() { | 184 | 10.0k | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 10.0k | } |
crossbeam_utils::thread::scope::<array::try_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::recv_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::try_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::linearizable::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::drops::{closure#0}, ()>Line | Count | Source | 148 | 100 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 100 | where | 150 | 100 | F: FnOnce(&Scope<'env>) -> R, | 151 | 100 | { | 152 | 100 | let wg = WaitGroup::new(); | 153 | 100 | let scope = Scope::<'env> { | 154 | 100 | handles: SharedVec::default(), | 155 | 100 | wait_group: wg.clone(), | 156 | 100 | _marker: PhantomData, | 157 | 100 | }; | 158 | 100 | | 159 | 100 | // Execute the scoped function, but catch any panics. | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 100 | | 162 | 100 | // Wait until all nested scopes are dropped. | 163 | 100 | drop(scope.wait_group); | 164 | 100 | wg.wait(); | 165 | 100 | | 166 | 100 | // Join all remaining spawned threads. | 167 | 100 | let panics: Vec<_> = scope | 168 | 100 | .handles | 169 | 100 | .lock() | 170 | 100 | .unwrap() | 171 | 100 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 100 | .drain(..) | 173 | 100 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 100 | .filter_map(|handle| handle.join().err()) | 175 | 100 | .collect(); | 176 | 100 | | 177 | 100 | // If `f` has panicked, resume unwinding. | 178 | 100 | // If any of the child threads have panicked, return the panic errors. | 179 | 100 | // Otherwise, everything is OK and return the result of `f`. | 180 | 100 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 100 | Ok(res) => { | 183 | 100 | if panics.is_empty() { | 184 | 100 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 100 | } |
crossbeam_utils::thread::scope::<array::send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::send_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::stress_iter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array::recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<iter::recv_try_iter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<iter::recv_iter_break::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<iter::nested_recv_iter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
Unexecuted instantiation: crossbeam_utils::thread::scope::<thread_locals::use_while_exiting::{closure#0}, ()>crossbeam_utils::thread::scope::<tick::select::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<tick::ready::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<tick::recv_two::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array_queue::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array_queue::linearizable::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array_queue::len::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<array_queue::drops::{closure#0}, ()>Line | Count | Source | 148 | 100 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 100 | where | 150 | 100 | F: FnOnce(&Scope<'env>) -> R, | 151 | 100 | { | 152 | 100 | let wg = WaitGroup::new(); | 153 | 100 | let scope = Scope::<'env> { | 154 | 100 | handles: SharedVec::default(), | 155 | 100 | wait_group: wg.clone(), | 156 | 100 | _marker: PhantomData, | 157 | 100 | }; | 158 | 100 | | 159 | 100 | // Execute the scoped function, but catch any panics. | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 100 | | 162 | 100 | // Wait until all nested scopes are dropped. | 163 | 100 | drop(scope.wait_group); | 164 | 100 | wg.wait(); | 165 | 100 | | 166 | 100 | // Join all remaining spawned threads. | 167 | 100 | let panics: Vec<_> = scope | 168 | 100 | .handles | 169 | 100 | .lock() | 170 | 100 | .unwrap() | 171 | 100 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 100 | .drain(..) | 173 | 100 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 100 | .filter_map(|handle| handle.join().err()) | 175 | 100 | .collect(); | 176 | 100 | | 177 | 100 | // If `f` has panicked, resume unwinding. | 178 | 100 | // If any of the child threads have panicked, return the panic errors. | 179 | 100 | // Otherwise, everything is OK and return the result of `f`. | 180 | 100 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 100 | Ok(res) => { | 183 | 100 | if panics.is_empty() { | 184 | 100 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 100 | } |
crossbeam_utils::thread::scope::<array_queue::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<subcrates::utils::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<fifo::no_starvation::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<fifo::stress::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<fifo::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<fifo::destructors::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<fifo::stampede::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::try_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::disconnect_wakes_receiver::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::stress_oneshot::{closure#0}, ()>Line | Count | Source | 148 | 10.0k | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 10.0k | where | 150 | 10.0k | F: FnOnce(&Scope<'env>) -> R, | 151 | 10.0k | { | 152 | 10.0k | let wg = WaitGroup::new(); | 153 | 10.0k | let scope = Scope::<'env> { | 154 | 10.0k | handles: SharedVec::default(), | 155 | 10.0k | wait_group: wg.clone(), | 156 | 10.0k | _marker: PhantomData, | 157 | 10.0k | }; | 158 | 10.0k | | 159 | 10.0k | // Execute the scoped function, but catch any panics. | 160 | 10.0k | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 10.0k | | 162 | 10.0k | // Wait until all nested scopes are dropped. | 163 | 10.0k | drop(scope.wait_group); | 164 | 10.0k | wg.wait(); | 165 | 10.0k | | 166 | 10.0k | // Join all remaining spawned threads. | 167 | 10.0k | let panics: Vec<_> = scope | 168 | 10.0k | .handles | 169 | 10.0k | .lock() | 170 | 10.0k | .unwrap() | 171 | 10.0k | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 10.0k | .drain(..) | 173 | 10.0k | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 10.0k | .filter_map(|handle| handle.join().err()) | 175 | 10.0k | .collect(); | 176 | 10.0k | | 177 | 10.0k | // If `f` has panicked, resume unwinding. | 178 | 10.0k | // If any of the child threads have panicked, return the panic errors. | 179 | 10.0k | // Otherwise, everything is OK and return the result of `f`. | 180 | 10.0k | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 10.0k | Ok(res) => { | 183 | 10.0k | if panics.is_empty() { | 184 | 10.0k | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 10.0k | } |
crossbeam_utils::thread::scope::<list::recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::drops::{closure#0}, ()>Line | Count | Source | 148 | 100 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 100 | where | 150 | 100 | F: FnOnce(&Scope<'env>) -> R, | 151 | 100 | { | 152 | 100 | let wg = WaitGroup::new(); | 153 | 100 | let scope = Scope::<'env> { | 154 | 100 | handles: SharedVec::default(), | 155 | 100 | wait_group: wg.clone(), | 156 | 100 | _marker: PhantomData, | 157 | 100 | }; | 158 | 100 | | 159 | 100 | // Execute the scoped function, but catch any panics. | 160 | 100 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 100 | | 162 | 100 | // Wait until all nested scopes are dropped. | 163 | 100 | drop(scope.wait_group); | 164 | 100 | wg.wait(); | 165 | 100 | | 166 | 100 | // Join all remaining spawned threads. | 167 | 100 | let panics: Vec<_> = scope | 168 | 100 | .handles | 169 | 100 | .lock() | 170 | 100 | .unwrap() | 171 | 100 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 100 | .drain(..) | 173 | 100 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 100 | .filter_map(|handle| handle.join().err()) | 175 | 100 | .collect(); | 176 | 100 | | 177 | 100 | // If `f` has panicked, resume unwinding. | 178 | 100 | // If any of the child threads have panicked, return the panic errors. | 179 | 100 | // Otherwise, everything is OK and return the result of `f`. | 180 | 100 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 100 | Ok(res) => { | 183 | 100 | if panics.is_empty() { | 184 | 100 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 100 | } |
crossbeam_utils::thread::scope::<list::linearizable::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::mpmc::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::recv_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::stress_iter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<list::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::both_ready::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::loop_try::{closure#0}, ()>Line | Count | Source | 148 | 20 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 20 | where | 150 | 20 | F: FnOnce(&Scope<'env>) -> R, | 151 | 20 | { | 152 | 20 | let wg = WaitGroup::new(); | 153 | 20 | let scope = Scope::<'env> { | 154 | 20 | handles: SharedVec::default(), | 155 | 20 | wait_group: wg.clone(), | 156 | 20 | _marker: PhantomData, | 157 | 20 | }; | 158 | 20 | | 159 | 20 | // Execute the scoped function, but catch any panics. | 160 | 20 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 20 | | 162 | 20 | // Wait until all nested scopes are dropped. | 163 | 20 | drop(scope.wait_group); | 164 | 20 | wg.wait(); | 165 | 20 | | 166 | 20 | // Join all remaining spawned threads. | 167 | 20 | let panics: Vec<_> = scope | 168 | 20 | .handles | 169 | 20 | .lock() | 170 | 20 | .unwrap() | 171 | 20 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 20 | .drain(..) | 173 | 20 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 20 | .filter_map(|handle| handle.join().err()) | 175 | 20 | .collect(); | 176 | 20 | | 177 | 20 | // If `f` has panicked, resume unwinding. | 178 | 20 | // If any of the child threads have panicked, return the panic errors. | 179 | 20 | // Otherwise, everything is OK and return the result of `f`. | 180 | 20 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 20 | Ok(res) => { | 183 | 20 | if panics.is_empty() { | 184 | 20 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 20 | } |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_sender::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::timeout::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::fairness2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::stress_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::linearizable_default::{closure#0}, ()>Line | Count | Source | 148 | 2 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 2 | where | 150 | 2 | F: FnOnce(&Scope<'env>) -> R, | 151 | 2 | { | 152 | 2 | let wg = WaitGroup::new(); | 153 | 2 | let scope = Scope::<'env> { | 154 | 2 | handles: SharedVec::default(), | 155 | 2 | wait_group: wg.clone(), | 156 | 2 | _marker: PhantomData, | 157 | 2 | }; | 158 | 2 | | 159 | 2 | // Execute the scoped function, but catch any panics. | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 2 | | 162 | 2 | // Wait until all nested scopes are dropped. | 163 | 2 | drop(scope.wait_group); | 164 | 2 | wg.wait(); | 165 | 2 | | 166 | 2 | // Join all remaining spawned threads. | 167 | 2 | let panics: Vec<_> = scope | 168 | 2 | .handles | 169 | 2 | .lock() | 170 | 2 | .unwrap() | 171 | 2 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 2 | .drain(..) | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 2 | .filter_map(|handle| handle.join().err()) | 175 | 2 | .collect(); | 176 | 2 | | 177 | 2 | // If `f` has panicked, resume unwinding. | 178 | 2 | // If any of the child threads have panicked, return the panic errors. | 179 | 2 | // Otherwise, everything is OK and return the result of `f`. | 180 | 2 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 2 | Ok(res) => { | 183 | 2 | if panics.is_empty() { | 184 | 2 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 2 | } |
crossbeam_utils::thread::scope::<select_macro::matching_with_leftover::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::try_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 3 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 3 | where | 150 | 3 | F: FnOnce(&Scope<'env>) -> R, | 151 | 3 | { | 152 | 3 | let wg = WaitGroup::new(); | 153 | 3 | let scope = Scope::<'env> { | 154 | 3 | handles: SharedVec::default(), | 155 | 3 | wait_group: wg.clone(), | 156 | 3 | _marker: PhantomData, | 157 | 3 | }; | 158 | 3 | | 159 | 3 | // Execute the scoped function, but catch any panics. | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 3 | | 162 | 3 | // Wait until all nested scopes are dropped. | 163 | 3 | drop(scope.wait_group); | 164 | 3 | wg.wait(); | 165 | 3 | | 166 | 3 | // Join all remaining spawned threads. | 167 | 3 | let panics: Vec<_> = scope | 168 | 3 | .handles | 169 | 3 | .lock() | 170 | 3 | .unwrap() | 171 | 3 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 3 | .drain(..) | 173 | 3 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 3 | .filter_map(|handle| handle.join().err()) | 175 | 3 | .collect(); | 176 | 3 | | 177 | 3 | // If `f` has panicked, resume unwinding. | 178 | 3 | // If any of the child threads have panicked, return the panic errors. | 179 | 3 | // Otherwise, everything is OK and return the result of `f`. | 180 | 3 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 3 | Ok(res) => { | 183 | 3 | if panics.is_empty() { | 184 | 3 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 3 | } |
crossbeam_utils::thread::scope::<select_macro::stress_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::disconnect_wakes_receiver::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::recv_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::matching::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::disconnected::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::stress_mixed::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::send_timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::unblocks::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::linearizable_timeout::{closure#0}, ()>Line | Count | Source | 148 | 2 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 2 | where | 150 | 2 | F: FnOnce(&Scope<'env>) -> R, | 151 | 2 | { | 152 | 2 | let wg = WaitGroup::new(); | 153 | 2 | let scope = Scope::<'env> { | 154 | 2 | handles: SharedVec::default(), | 155 | 2 | wait_group: wg.clone(), | 156 | 2 | _marker: PhantomData, | 157 | 2 | }; | 158 | 2 | | 159 | 2 | // Execute the scoped function, but catch any panics. | 160 | 2 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 2 | | 162 | 2 | // Wait until all nested scopes are dropped. | 163 | 2 | drop(scope.wait_group); | 164 | 2 | wg.wait(); | 165 | 2 | | 166 | 2 | // Join all remaining spawned threads. | 167 | 2 | let panics: Vec<_> = scope | 168 | 2 | .handles | 169 | 2 | .lock() | 170 | 2 | .unwrap() | 171 | 2 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 2 | .drain(..) | 173 | 2 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 2 | .filter_map(|handle| handle.join().err()) | 175 | 2 | .collect(); | 176 | 2 | | 177 | 2 | // If `f` has panicked, resume unwinding. | 178 | 2 | // If any of the child threads have panicked, return the panic errors. | 179 | 2 | // Otherwise, everything is OK and return the result of `f`. | 180 | 2 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 2 | Ok(res) => { | 183 | 2 | if panics.is_empty() { | 184 | 2 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 2 | } |
crossbeam_utils::thread::scope::<select_macro::try_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::cloning1::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<select_macro::cloning2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::fairness2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::cloning2::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::stress_recv::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::stress_timeout_two_threads::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::both_ready::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::cloning1::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::timeout::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::stress_mixed::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::timeout::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::unblocks::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::stress_send::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::disconnected::{closure#1}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<ready::channel_through_channel::{closure#0}, ()>Line | Count | Source | 148 | 3 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 3 | where | 150 | 3 | F: FnOnce(&Scope<'env>) -> R, | 151 | 3 | { | 152 | 3 | let wg = WaitGroup::new(); | 153 | 3 | let scope = Scope::<'env> { | 154 | 3 | handles: SharedVec::default(), | 155 | 3 | wait_group: wg.clone(), | 156 | 3 | _marker: PhantomData, | 157 | 3 | }; | 158 | 3 | | 159 | 3 | // Execute the scoped function, but catch any panics. | 160 | 3 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 3 | | 162 | 3 | // Wait until all nested scopes are dropped. | 163 | 3 | drop(scope.wait_group); | 164 | 3 | wg.wait(); | 165 | 3 | | 166 | 3 | // Join all remaining spawned threads. | 167 | 3 | let panics: Vec<_> = scope | 168 | 3 | .handles | 169 | 3 | .lock() | 170 | 3 | .unwrap() | 171 | 3 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 3 | .drain(..) | 173 | 3 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 3 | .filter_map(|handle| handle.join().err()) | 175 | 3 | .collect(); | 176 | 3 | | 177 | 3 | // If `f` has panicked, resume unwinding. | 178 | 3 | // If any of the child threads have panicked, return the panic errors. | 179 | 3 | // Otherwise, everything is OK and return the result of `f`. | 180 | 3 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 3 | Ok(res) => { | 183 | 3 | if panics.is_empty() { | 184 | 3 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 3 | } |
crossbeam_utils::thread::scope::<parker::park_timeout_unpark_called_other_thread::{closure#0}, ()>Line | Count | Source | 148 | 10 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 10 | where | 150 | 10 | F: FnOnce(&Scope<'env>) -> R, | 151 | 10 | { | 152 | 10 | let wg = WaitGroup::new(); | 153 | 10 | let scope = Scope::<'env> { | 154 | 10 | handles: SharedVec::default(), | 155 | 10 | wait_group: wg.clone(), | 156 | 10 | _marker: PhantomData, | 157 | 10 | }; | 158 | 10 | | 159 | 10 | // Execute the scoped function, but catch any panics. | 160 | 10 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 10 | | 162 | 10 | // Wait until all nested scopes are dropped. | 163 | 10 | drop(scope.wait_group); | 164 | 10 | wg.wait(); | 165 | 10 | | 166 | 10 | // Join all remaining spawned threads. | 167 | 10 | let panics: Vec<_> = scope | 168 | 10 | .handles | 169 | 10 | .lock() | 170 | 10 | .unwrap() | 171 | 10 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 10 | .drain(..) | 173 | 10 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 10 | .filter_map(|handle| handle.join().err()) | 175 | 10 | .collect(); | 176 | 10 | | 177 | 10 | // If `f` has panicked, resume unwinding. | 178 | 10 | // If any of the child threads have panicked, return the panic errors. | 179 | 10 | // Otherwise, everything is OK and return the result of `f`. | 180 | 10 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 10 | Ok(res) => { | 183 | 10 | if panics.is_empty() { | 184 | 10 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 10 | } |
crossbeam_utils::thread::scope::<lifo::spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<lifo::stress::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<lifo::destructors::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<lifo::stampede::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<lifo::no_starvation::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::scope_returns_ok::{closure#0}, i32>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::nesting::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::join::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::panic_twice::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 0 | Ok(res) | 185 | | } else { | 186 | 1 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::counter_builder::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::counter_panic::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 0 | Ok(res) | 185 | | } else { | 186 | 1 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::panic_many::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 0 | Ok(res) | 185 | | } else { | 186 | 1 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::join_nested::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::as_pthread_t::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<thread::counter::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::stress::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
crossbeam_utils::thread::scope::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}, ()>Line | Count | Source | 148 | 1 | pub fn scope<'env, F, R>(f: F) -> thread::Result<R> | 149 | 1 | where | 150 | 1 | F: FnOnce(&Scope<'env>) -> R, | 151 | 1 | { | 152 | 1 | let wg = WaitGroup::new(); | 153 | 1 | let scope = Scope::<'env> { | 154 | 1 | handles: SharedVec::default(), | 155 | 1 | wait_group: wg.clone(), | 156 | 1 | _marker: PhantomData, | 157 | 1 | }; | 158 | 1 | | 159 | 1 | // Execute the scoped function, but catch any panics. | 160 | 1 | let result = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&scope))); | 161 | 1 | | 162 | 1 | // Wait until all nested scopes are dropped. | 163 | 1 | drop(scope.wait_group); | 164 | 1 | wg.wait(); | 165 | 1 | | 166 | 1 | // Join all remaining spawned threads. | 167 | 1 | let panics: Vec<_> = scope | 168 | 1 | .handles | 169 | 1 | .lock() | 170 | 1 | .unwrap() | 171 | 1 | // Filter handles that haven't been joined, join them, and collect errors. | 172 | 1 | .drain(..) | 173 | 1 | .filter_map(|handle| handle.lock().unwrap().take()) | 174 | 1 | .filter_map(|handle| handle.join().err()) | 175 | 1 | .collect(); | 176 | 1 | | 177 | 1 | // If `f` has panicked, resume unwinding. | 178 | 1 | // If any of the child threads have panicked, return the panic errors. | 179 | 1 | // Otherwise, everything is OK and return the result of `f`. | 180 | 1 | match result { | 181 | 0 | Err(err) => panic::resume_unwind(err), | 182 | 1 | Ok(res) => { | 183 | 1 | if panics.is_empty() { | 184 | 1 | Ok(res) | 185 | | } else { | 186 | 0 | Err(Box::new(panics)) | 187 | | } | 188 | | } | 189 | | } | 190 | 1 | } |
|
191 | | |
192 | | /// A scope for spawning threads. |
193 | | pub struct Scope<'env> { |
194 | | /// The list of the thread join handles. |
195 | | handles: SharedVec<SharedOption<thread::JoinHandle<()>>>, |
196 | | |
197 | | /// Used to wait until all subscopes all dropped. |
198 | | wait_group: WaitGroup, |
199 | | |
200 | | /// Borrows data with invariant lifetime `'env`. |
201 | | _marker: PhantomData<&'env mut &'env ()>, |
202 | | } |
203 | | |
204 | | unsafe impl Sync for Scope<'_> {} |
205 | | |
206 | | impl<'env> Scope<'env> { |
207 | | /// Spawns a scoped thread. |
208 | | /// |
209 | | /// This method is similar to the [`spawn`] function in Rust's standard library. The difference |
210 | | /// is that this thread is scoped, meaning it's guaranteed to terminate before the scope exits, |
211 | | /// allowing it to reference variables outside the scope. |
212 | | /// |
213 | | /// The scoped thread is passed a reference to this scope as an argument, which can be used for |
214 | | /// spawning nested threads. |
215 | | /// |
216 | | /// The returned [handle](ScopedJoinHandle) can be used to manually |
217 | | /// [join](ScopedJoinHandle::join) the thread before the scope exits. |
218 | | /// |
219 | | /// This will create a thread using default parameters of [`ScopedThreadBuilder`], if you want to specify the |
220 | | /// stack size or the name of the thread, use this API instead. |
221 | | /// |
222 | | /// [`spawn`]: std::thread::spawn |
223 | | /// |
224 | | /// # Panics |
225 | | /// |
226 | | /// Panics if the OS fails to create a thread; use [`ScopedThreadBuilder::spawn`] |
227 | | /// to recover from such errors. |
228 | | /// |
229 | | /// # Examples |
230 | | /// |
231 | | /// ``` |
232 | | /// use crossbeam_utils::thread; |
233 | | /// |
234 | | /// thread::scope(|s| { |
235 | | /// let handle = s.spawn(|_| { |
236 | | /// println!("A child thread is running"); |
237 | | /// 42 |
238 | | /// }); |
239 | | /// |
240 | | /// // Join the thread and retrieve its result. |
241 | | /// let res = handle.join().unwrap(); |
242 | | /// assert_eq!(res, 42); |
243 | | /// }).unwrap(); |
244 | | /// ``` |
245 | 71.8k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> |
246 | 71.8k | where |
247 | 71.8k | F: FnOnce(&Scope<'env>) -> T, |
248 | 71.8k | F: Send + 'env, |
249 | 71.8k | T: Send + 'env, |
250 | 71.8k | { |
251 | 71.8k | self.builder() |
252 | 71.8k | .spawn(f) |
253 | 71.8k | .expect("failed to spawn scoped thread") |
254 | 71.8k | } <crossbeam_utils::thread::Scope>::spawn::<injector::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<injector::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::len_empty_full::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::fairness_duplicates::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::fairness::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::len_empty_full::{closure#0}::{closure#1}, i32>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv_in_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv_in_send::{closure#0}::{closure#0}, core::result::Result<(), crossbeam_channel::err::RecvError>>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<zero::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<seg_queue::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::sync_and_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::loop_try::{closure#0}::{closure#2}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::linearizable_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::matching_with_leftover::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 55 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 55 | where | 247 | 55 | F: FnOnce(&Scope<'env>) -> T, | 248 | 55 | F: Send + 'env, | 249 | 55 | T: Send + 'env, | 250 | 55 | { | 251 | 55 | self.builder() | 252 | 55 | .spawn(f) | 253 | 55 | .expect("failed to spawn scoped thread") | 254 | 55 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::loop_try::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::send_and_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::reuse::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::loop_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::matching::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 44 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 44 | where | 247 | 44 | F: FnOnce(&Scope<'env>) -> T, | 248 | 44 | F: Send + 'env, | 249 | 44 | T: Send + 'env, | 250 | 44 | { | 251 | 44 | self.builder() | 252 | 44 | .spawn(f) | 253 | 44 | .expect("failed to spawn scoped thread") | 254 | 44 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::linearizable_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<after::stress_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<after::recv_two::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<after::recv_two::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<after::ready::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<after::select::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<array::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<array::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<iter::nested_recv_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<iter::recv_try_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<iter::recv_iter_break::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<tick::recv_two::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<tick::recv_two::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<tick::ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<tick::select::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<array_queue::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<subcrates::utils::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<subcrates::utils::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<fifo::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<fifo::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<fifo::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<fifo::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<fifo::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 100 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 100 | where | 247 | 100 | F: FnOnce(&Scope<'env>) -> T, | 248 | 100 | F: Send + 'env, | 249 | 100 | T: Send + 'env, | 250 | 100 | { | 251 | 100 | self.builder() | 252 | 100 | .spawn(f) | 253 | 100 | .expect("failed to spawn scoped thread") | 254 | 100 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 4 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 4 | where | 247 | 4 | F: FnOnce(&Scope<'env>) -> T, | 248 | 4 | F: Send + 'env, | 249 | 4 | T: Send + 'env, | 250 | 4 | { | 251 | 4 | self.builder() | 252 | 4 | .spawn(f) | 253 | 4 | .expect("failed to spawn scoped thread") | 254 | 4 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<list::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 10.0k | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10.0k | where | 247 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 248 | 10.0k | F: Send + 'env, | 249 | 10.0k | T: Send + 'env, | 250 | 10.0k | { | 251 | 10.0k | self.builder() | 252 | 10.0k | .spawn(f) | 253 | 10.0k | .expect("failed to spawn scoped thread") | 254 | 10.0k | } |
<crossbeam_utils::thread::Scope>::spawn::<list::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::linearizable_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::loop_try::{closure#0}::{closure#2}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::matching::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 44 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 44 | where | 247 | 44 | F: FnOnce(&Scope<'env>) -> T, | 248 | 44 | F: Send + 'env, | 249 | 44 | T: Send + 'env, | 250 | 44 | { | 251 | 44 | self.builder() | 252 | 44 | .spawn(f) | 253 | 44 | .expect("failed to spawn scoped thread") | 254 | 44 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::linearizable_default::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::matching_with_leftover::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 55 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 55 | where | 247 | 55 | F: FnOnce(&Scope<'env>) -> T, | 248 | 55 | F: Send + 'env, | 249 | 55 | T: Send + 'env, | 250 | 55 | { | 251 | 55 | self.builder() | 252 | 55 | .spawn(f) | 253 | 55 | .expect("failed to spawn scoped thread") | 254 | 55 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::loop_try::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::loop_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 20 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 20 | where | 247 | 20 | F: FnOnce(&Scope<'env>) -> T, | 248 | 20 | F: Send + 'env, | 249 | 20 | T: Send + 'env, | 250 | 20 | { | 251 | 20 | self.builder() | 252 | 20 | .spawn(f) | 253 | 20 | .expect("failed to spawn scoped thread") | 254 | 20 | } |
<crossbeam_utils::thread::Scope>::spawn::<select_macro::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<ready::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<parker::park_timeout_unpark_called_other_thread::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 10 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10 | where | 247 | 10 | F: FnOnce(&Scope<'env>) -> T, | 248 | 10 | F: Send + 'env, | 249 | 10 | T: Send + 'env, | 250 | 10 | { | 251 | 10 | self.builder() | 252 | 10 | .spawn(f) | 253 | 10 | .expect("failed to spawn scoped thread") | 254 | 10 | } |
<crossbeam_utils::thread::Scope>::spawn::<lifo::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<lifo::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<lifo::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<lifo::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<lifo::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::join::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::panic_many::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::counter::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 10 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10 | where | 247 | 10 | F: FnOnce(&Scope<'env>) -> T, | 248 | 10 | F: Send + 'env, | 249 | 10 | T: Send + 'env, | 250 | 10 | { | 251 | 10 | self.builder() | 252 | 10 | .spawn(f) | 253 | 10 | .expect("failed to spawn scoped thread") | 254 | 10 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::scope_returns_ok::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<<thread::nesting::Wrapper>::recurse::{closure#0}, ()>Line | Count | Source | 245 | 5 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 5 | where | 247 | 5 | F: FnOnce(&Scope<'env>) -> T, | 248 | 5 | F: Send + 'env, | 249 | 5 | T: Send + 'env, | 250 | 5 | { | 251 | 5 | self.builder() | 252 | 5 | .spawn(f) | 253 | 5 | .expect("failed to spawn scoped thread") | 254 | 5 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::join::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::panic_many::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::join_nested::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::panic_twice::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::counter_panic::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 10 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 10 | where | 247 | 10 | F: FnOnce(&Scope<'env>) -> T, | 248 | 10 | F: Send + 'env, | 249 | 10 | T: Send + 'env, | 250 | 10 | { | 251 | 10 | self.builder() | 252 | 10 | .spawn(f) | 253 | 10 | .expect("failed to spawn scoped thread") | 254 | 10 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::join_nested::{closure#0}::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::nesting::{closure#0}::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::panic_twice::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::counter_panic::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::nesting::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::panic_many::{closure#0}::{closure#2}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<thread::as_pthread_t::{closure#0}::{closure#0}, i32>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::collector::tests::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#2}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#1}, ()>Line | Count | Source | 245 | 2 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 2 | where | 247 | 2 | F: FnOnce(&Scope<'env>) -> T, | 248 | 2 | F: Send + 'env, | 249 | 2 | T: Send + 'env, | 250 | 2 | { | 251 | 2 | self.builder() | 252 | 2 | .spawn(f) | 253 | 2 | .expect("failed to spawn scoped thread") | 254 | 2 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 3 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 3 | where | 247 | 3 | F: FnOnce(&Scope<'env>) -> T, | 248 | 3 | F: Send + 'env, | 249 | 3 | T: Send + 'env, | 250 | 3 | { | 251 | 3 | self.builder() | 252 | 3 | .spawn(f) | 253 | 3 | .expect("failed to spawn scoped thread") | 254 | 3 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 1 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 1 | where | 247 | 1 | F: FnOnce(&Scope<'env>) -> T, | 248 | 1 | F: Send + 'env, | 249 | 1 | T: Send + 'env, | 250 | 1 | { | 251 | 1 | self.builder() | 252 | 1 | .spawn(f) | 253 | 1 | .expect("failed to spawn scoped thread") | 254 | 1 | } |
<crossbeam_utils::thread::Scope>::spawn::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}::{closure#0}, ()>Line | Count | Source | 245 | 8 | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> | 246 | 8 | where | 247 | 8 | F: FnOnce(&Scope<'env>) -> T, | 248 | 8 | F: Send + 'env, | 249 | 8 | T: Send + 'env, | 250 | 8 | { | 251 | 8 | self.builder() | 252 | 8 | .spawn(f) | 253 | 8 | .expect("failed to spawn scoped thread") | 254 | 8 | } |
|
255 | | |
256 | | /// Creates a builder that can configure a thread before spawning. |
257 | | /// |
258 | | /// # Examples |
259 | | /// |
260 | | /// ``` |
261 | | /// use crossbeam_utils::thread; |
262 | | /// |
263 | | /// thread::scope(|s| { |
264 | | /// s.builder() |
265 | | /// .spawn(|_| println!("A child thread is running")) |
266 | | /// .unwrap(); |
267 | | /// }).unwrap(); |
268 | | /// ``` |
269 | 71.8k | pub fn builder<'scope>(&'scope self) -> ScopedThreadBuilder<'scope, 'env> { |
270 | 71.8k | ScopedThreadBuilder { |
271 | 71.8k | scope: self, |
272 | 71.8k | builder: thread::Builder::new(), |
273 | 71.8k | } |
274 | 71.8k | } |
275 | | } |
276 | | |
277 | | impl fmt::Debug for Scope<'_> { |
278 | | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
279 | | f.pad("Scope { .. }") |
280 | | } |
281 | | } |
282 | | |
283 | | /// Configures the properties of a new thread. |
284 | | /// |
285 | | /// The two configurable properties are: |
286 | | /// |
287 | | /// - [`name`]: Specifies an [associated name for the thread][naming-threads]. |
288 | | /// - [`stack_size`]: Specifies the [desired stack size for the thread][stack-size]. |
289 | | /// |
290 | | /// The [`spawn`] method will take ownership of the builder and return an [`io::Result`] of the |
291 | | /// thread handle with the given configuration. |
292 | | /// |
293 | | /// The [`Scope::spawn`] method uses a builder with default configuration and unwraps its return |
294 | | /// value. You may want to use this builder when you want to recover from a failure to launch a |
295 | | /// thread. |
296 | | /// |
297 | | /// # Examples |
298 | | /// |
299 | | /// ``` |
300 | | /// use crossbeam_utils::thread; |
301 | | /// |
302 | | /// thread::scope(|s| { |
303 | | /// s.builder() |
304 | | /// .spawn(|_| println!("Running a child thread")) |
305 | | /// .unwrap(); |
306 | | /// }).unwrap(); |
307 | | /// ``` |
308 | | /// |
309 | | /// [`name`]: ScopedThreadBuilder::name |
310 | | /// [`stack_size`]: ScopedThreadBuilder::stack_size |
311 | | /// [`spawn`]: ScopedThreadBuilder::spawn |
312 | | /// [`io::Result`]: std::io::Result |
313 | | /// [naming-threads]: std::thread#naming-threads |
314 | | /// [stack-size]: std::thread#stack-size |
315 | | #[derive(Debug)] |
316 | | pub struct ScopedThreadBuilder<'scope, 'env> { |
317 | | scope: &'scope Scope<'env>, |
318 | | builder: thread::Builder, |
319 | | } |
320 | | |
321 | | impl<'scope, 'env> ScopedThreadBuilder<'scope, 'env> { |
322 | | /// Sets the name for the new thread. |
323 | | /// |
324 | | /// The name must not contain null bytes (`\0`). |
325 | | /// |
326 | | /// For more information about named threads, see [here][naming-threads]. |
327 | | /// |
328 | | /// # Examples |
329 | | /// |
330 | | /// ``` |
331 | | /// use crossbeam_utils::thread; |
332 | | /// use std::thread::current; |
333 | | /// |
334 | | /// thread::scope(|s| { |
335 | | /// s.builder() |
336 | | /// .name("my thread".to_string()) |
337 | | /// .spawn(|_| assert_eq!(current().name(), Some("my thread"))) |
338 | | /// .unwrap(); |
339 | | /// }).unwrap(); |
340 | | /// ``` |
341 | | /// |
342 | | /// [naming-threads]: std::thread#naming-threads |
343 | 11 | pub fn name(mut self, name: String) -> ScopedThreadBuilder<'scope, 'env> { |
344 | 11 | self.builder = self.builder.name(name); |
345 | 11 | self |
346 | 11 | } |
347 | | |
348 | | /// Sets the size of the stack for the new thread. |
349 | | /// |
350 | | /// The stack size is measured in bytes. |
351 | | /// |
352 | | /// For more information about the stack size for threads, see [here][stack-size]. |
353 | | /// |
354 | | /// # Examples |
355 | | /// |
356 | | /// ``` |
357 | | /// use crossbeam_utils::thread; |
358 | | /// |
359 | | /// thread::scope(|s| { |
360 | | /// s.builder() |
361 | | /// .stack_size(32 * 1024) |
362 | | /// .spawn(|_| println!("Running a child thread")) |
363 | | /// .unwrap(); |
364 | | /// }).unwrap(); |
365 | | /// ``` |
366 | | /// |
367 | | /// [stack-size]: std::thread#stack-size |
368 | 10 | pub fn stack_size(mut self, size: usize) -> ScopedThreadBuilder<'scope, 'env> { |
369 | 10 | self.builder = self.builder.stack_size(size); |
370 | 10 | self |
371 | 10 | } |
372 | | |
373 | | /// Spawns a scoped thread with this configuration. |
374 | | /// |
375 | | /// The scoped thread is passed a reference to this scope as an argument, which can be used for |
376 | | /// spawning nested threads. |
377 | | /// |
378 | | /// The returned handle can be used to manually join the thread before the scope exits. |
379 | | /// |
380 | | /// # Errors |
381 | | /// |
382 | | /// Unlike the [`Scope::spawn`] method, this method yields an |
383 | | /// [`io::Result`] to capture any failure to create the thread at |
384 | | /// the OS level. |
385 | | /// |
386 | | /// [`io::Result`]: std::io::Result |
387 | | /// |
388 | | /// # Panics |
389 | | /// |
390 | | /// Panics if a thread name was set and it contained null bytes. |
391 | | /// |
392 | | /// # Examples |
393 | | /// |
394 | | /// ``` |
395 | | /// use crossbeam_utils::thread; |
396 | | /// |
397 | | /// thread::scope(|s| { |
398 | | /// let handle = s.builder() |
399 | | /// .spawn(|_| { |
400 | | /// println!("A child thread is running"); |
401 | | /// 42 |
402 | | /// }) |
403 | | /// .unwrap(); |
404 | | /// |
405 | | /// // Join the thread and retrieve its result. |
406 | | /// let res = handle.join().unwrap(); |
407 | | /// assert_eq!(res, 42); |
408 | | /// }).unwrap(); |
409 | | /// ``` |
410 | 71.8k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> |
411 | 71.8k | where |
412 | 71.8k | F: FnOnce(&Scope<'env>) -> T, |
413 | 71.8k | F: Send + 'env, |
414 | 71.8k | T: Send + 'env, |
415 | 71.8k | { |
416 | 71.8k | // The result of `f` will be stored here. |
417 | 71.8k | let result = SharedOption::default(); |
418 | | |
419 | | // Spawn the thread and grab its join handle and thread handle. |
420 | 71.8k | let (handle, thread) = { |
421 | 71.8k | let result = Arc::clone(&result); |
422 | 71.8k | |
423 | 71.8k | // A clone of the scope that will be moved into the new thread. |
424 | 71.8k | let scope = Scope::<'env> { |
425 | 71.8k | handles: Arc::clone(&self.scope.handles), |
426 | 71.8k | wait_group: self.scope.wait_group.clone(), |
427 | 71.8k | _marker: PhantomData, |
428 | 71.8k | }; |
429 | | |
430 | | // Spawn the thread. |
431 | 71.8k | let handle = { |
432 | 71.8k | let closure = move || { |
433 | 71.8k | // Make sure the scope is inside the closure with the proper `'env` lifetime. |
434 | 71.8k | let scope: Scope<'env> = scope; |
435 | 71.8k | |
436 | 71.8k | // Run the closure. |
437 | 71.8k | let res = f(&scope); |
438 | 71.8k | |
439 | 71.8k | // Store the result if the closure didn't panic. |
440 | 71.8k | *result.lock().unwrap() = Some(res); |
441 | 71.8k | }; <crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::no_starvation::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::destructors::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 7 | let closure = move || { | 433 | 7 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 7 | let scope: Scope<'env> = scope; | 435 | 7 | | 436 | 7 | // Run the closure. | 437 | 7 | let res = f(&scope); | 438 | 7 | | 439 | 7 | // Store the result if the closure didn't panic. | 440 | 7 | *result.lock().unwrap() = Some(res); | 441 | 7 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stress::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stampede::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#0}, core::result::Result<(), crossbeam_channel::err::RecvError>>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#1}, i32>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness_duplicates::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_iter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning1::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::both_ready::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 44 | let closure = move || { | 433 | 44 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 44 | let scope: Scope<'env> = scope; | 435 | 44 | | 436 | 44 | // Run the closure. | 437 | 44 | let res = f(&scope); | 438 | 44 | | 439 | 44 | // Store the result if the closure didn't panic. | 440 | 44 | *result.lock().unwrap() = Some(res); | 441 | 44 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_try::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching_with_leftover::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 55 | let closure = move || { | 433 | 55 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 55 | let scope: Scope<'env> = scope; | 435 | 55 | | 436 | 55 | // Run the closure. | 437 | 55 | let res = f(&scope); | 438 | 55 | | 439 | 55 | // Store the result if the closure didn't panic. | 440 | 55 | *result.lock().unwrap() = Some(res); | 441 | 55 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::sync_and_clone::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::send_and_clone::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::reuse::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::fairness2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#2}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::stress_clone::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 9.99k | let closure = move || { | 433 | 9.99k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 9.99k | let scope: Scope<'env> = scope; | 435 | 9.99k | | 436 | 9.99k | // Run the closure. | 437 | 9.99k | let res = f(&scope); | 438 | 9.99k | | 439 | 9.99k | // Store the result if the closure didn't panic. | 440 | 9.99k | *result.lock().unwrap() = Some(res); | 441 | 9.99k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::ready::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::select::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::linearizable::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_iter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_try_iter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_iter_break::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::nested_recv_iter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::select::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::ready::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::linearizable::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::destructors::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stress::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stampede::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::no_starvation::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::linearizable::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 4 | let closure = move || { | 433 | 4 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 4 | let scope: Scope<'env> = scope; | 435 | 4 | | 436 | 4 | // Run the closure. | 437 | 4 | let res = f(&scope); | 438 | 4 | | 439 | 4 | // Store the result if the closure didn't panic. | 440 | 4 | *result.lock().unwrap() = Some(res); | 441 | 4 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 10.0k | let closure = move || { | 433 | 10.0k | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10.0k | let scope: Scope<'env> = scope; | 435 | 10.0k | | 436 | 10.0k | // Run the closure. | 437 | 10.0k | let res = f(&scope); | 438 | 10.0k | | 439 | 10.0k | // Store the result if the closure didn't panic. | 440 | 10.0k | *result.lock().unwrap() = Some(res); | 441 | 10.0k | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 100 | let closure = move || { | 433 | 100 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 100 | let scope: Scope<'env> = scope; | 435 | 100 | | 436 | 100 | // Run the closure. | 437 | 100 | let res = f(&scope); | 438 | 100 | | 439 | 100 | // Store the result if the closure didn't panic. | 440 | 100 | *result.lock().unwrap() = Some(res); | 441 | 100 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_iter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 44 | let closure = move || { | 433 | 44 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 44 | let scope: Scope<'env> = scope; | 435 | 44 | | 436 | 44 | // Run the closure. | 437 | 44 | let res = f(&scope); | 438 | 44 | | 439 | 44 | // Store the result if the closure didn't panic. | 440 | 44 | *result.lock().unwrap() = Some(res); | 441 | 44 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_default::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning1::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::both_ready::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching_with_leftover::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 55 | let closure = move || { | 433 | 55 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 55 | let scope: Scope<'env> = scope; | 435 | 55 | | 436 | 55 | // Run the closure. | 437 | 55 | let res = f(&scope); | 438 | 55 | | 439 | 55 | // Store the result if the closure didn't panic. | 440 | 55 | *result.lock().unwrap() = Some(res); | 441 | 55 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::fairness2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#2}, ()>::{closure#0}Line | Count | Source | 432 | 20 | let closure = move || { | 433 | 20 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 20 | let scope: Scope<'env> = scope; | 435 | 20 | | 436 | 20 | // Run the closure. | 437 | 20 | let res = f(&scope); | 438 | 20 | | 439 | 20 | // Store the result if the closure didn't panic. | 440 | 20 | *result.lock().unwrap() = Some(res); | 441 | 20 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::both_ready::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::fairness2::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_send::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning1::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#1}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_recv::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<parker::park_timeout_unpark_called_other_thread::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 10 | let closure = move || { | 433 | 10 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10 | let scope: Scope<'env> = scope; | 435 | 10 | | 436 | 10 | // Run the closure. | 437 | 10 | let res = f(&scope); | 438 | 10 | | 439 | 10 | // Store the result if the closure didn't panic. | 440 | 10 | *result.lock().unwrap() = Some(res); | 441 | 10 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::no_starvation::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::destructors::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stress::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stampede::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<<thread::nesting::Wrapper>::recurse::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 5 | let closure = move || { | 433 | 5 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 5 | let scope: Scope<'env> = scope; | 435 | 5 | | 436 | 5 | // Run the closure. | 437 | 5 | let res = f(&scope); | 438 | 5 | | 439 | 5 | // Store the result if the closure didn't panic. | 440 | 5 | *result.lock().unwrap() = Some(res); | 441 | 5 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#2}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_builder::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 10 | let closure = move || { | 433 | 10 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10 | let scope: Scope<'env> = scope; | 435 | 10 | | 436 | 10 | // Run the closure. | 437 | 10 | let res = f(&scope); | 438 | 10 | | 439 | 10 | // Store the result if the closure didn't panic. | 440 | 10 | *result.lock().unwrap() = Some(res); | 441 | 10 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::as_pthread_t::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::scope_returns_ok::{closure#0}::{closure#0}, i32>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 10 | let closure = move || { | 433 | 10 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 10 | let scope: Scope<'env> = scope; | 435 | 10 | | 436 | 10 | // Run the closure. | 437 | 10 | let res = f(&scope); | 438 | 10 | | 439 | 10 | // Store the result if the closure didn't panic. | 440 | 10 | *result.lock().unwrap() = Some(res); | 441 | 10 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 9 | let closure = move || { | 433 | 9 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 9 | let scope: Scope<'env> = scope; | 435 | 9 | | 436 | 9 | // Run the closure. | 437 | 9 | let res = f(&scope); | 438 | 9 | | 439 | 9 | // Store the result if the closure didn't panic. | 440 | 9 | *result.lock().unwrap() = Some(res); | 441 | 9 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#1}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#2}, ()>::{closure#0}Line | Count | Source | 432 | 2 | let closure = move || { | 433 | 2 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 2 | let scope: Scope<'env> = scope; | 435 | 2 | | 436 | 2 | // Run the closure. | 437 | 2 | let res = f(&scope); | 438 | 2 | | 439 | 2 | // Store the result if the closure didn't panic. | 440 | 2 | *result.lock().unwrap() = Some(res); | 441 | 2 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::stress::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 8 | let closure = move || { | 433 | 8 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 8 | let scope: Scope<'env> = scope; | 435 | 8 | | 436 | 8 | // Run the closure. | 437 | 8 | let res = f(&scope); | 438 | 8 | | 439 | 8 | // Store the result if the closure didn't panic. | 440 | 8 | *result.lock().unwrap() = Some(res); | 441 | 8 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 3 | let closure = move || { | 433 | 3 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 3 | let scope: Scope<'env> = scope; | 435 | 3 | | 436 | 3 | // Run the closure. | 437 | 3 | let res = f(&scope); | 438 | 3 | | 439 | 3 | // Store the result if the closure didn't panic. | 440 | 3 | *result.lock().unwrap() = Some(res); | 441 | 3 | }; |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}::{closure#0}, ()>::{closure#0}Line | Count | Source | 432 | 1 | let closure = move || { | 433 | 1 | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | 1 | let scope: Scope<'env> = scope; | 435 | 1 | | 436 | 1 | // Run the closure. | 437 | 1 | let res = f(&scope); | 438 | 1 | | 439 | 1 | // Store the result if the closure didn't panic. | 440 | 1 | *result.lock().unwrap() = Some(res); | 441 | 1 | }; |
|
442 | | |
443 | | // Allocate `closure` on the heap and erase the `'env` bound. |
444 | 71.8k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); |
445 | 71.8k | let closure: Box<dyn FnOnce() + Send + 'static> = |
446 | 71.8k | unsafe { mem::transmute(closure) }; |
447 | | |
448 | | // Finally, spawn the closure. |
449 | 71.8k | self.builder.spawn(move || closure()71.8k )?0 <crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::no_starvation::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::destructors::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 7 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stress::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stampede::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#0}, core::result::Result<(), crossbeam_channel::err::RecvError>>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#1}, i32>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_iter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness_duplicates::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::reuse::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#2}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::both_ready::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning1::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::send_and_clone::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::sync_and_clone::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_try::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching_with_leftover::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 55 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::fairness2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 44 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::select::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::stress_clone::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 9.99k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::ready::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::linearizable::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_iter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::nested_recv_iter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_iter_break::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_try_iter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::ready::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::select::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::linearizable::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::destructors::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stress::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stampede::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::no_starvation::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::linearizable::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 10.0k | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 100 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 4 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_iter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::both_ready::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning1::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 44 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#2}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching_with_leftover::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 55 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_default::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::fairness2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 20 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning1::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_send::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::both_ready::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_mixed::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::fairness2::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_recv::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#1}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<parker::park_timeout_unpark_called_other_thread::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 10 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stampede::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::no_starvation::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stress::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::destructors::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::as_pthread_t::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<<thread::nesting::Wrapper>::recurse::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 5 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 10 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::scope_returns_ok::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}::{closure#0}, i32>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#2}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_builder::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 10 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 10 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#2}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 3 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::stress::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 2 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}::{closure#0}, ()>::{closure#1}Line | Count | Source | 449 | 8 | self.builder.spawn(move || closure())? |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#1}, ()>::{closure#1}Line | Count | Source | 449 | 1 | self.builder.spawn(move || closure())? |
|
450 | | }; |
451 | | |
452 | 71.8k | let thread = handle.thread().clone(); |
453 | 71.8k | let handle = Arc::new(Mutex::new(Some(handle))); |
454 | 71.8k | (handle, thread) |
455 | 71.8k | }; |
456 | 71.8k | |
457 | 71.8k | // Add the handle to the shared list of join handles. |
458 | 71.8k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); |
459 | 71.8k | |
460 | 71.8k | Ok(ScopedJoinHandle { |
461 | 71.8k | handle, |
462 | 71.8k | result, |
463 | 71.8k | thread, |
464 | 71.8k | _marker: PhantomData, |
465 | 71.8k | }) |
466 | 71.8k | } <crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<injector::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::fairness_duplicates::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len_empty_full::{closure#0}::{closure#1}, i32>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::recv_in_send::{closure#0}::{closure#0}, core::result::Result<(), crossbeam_channel::err::RecvError>>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<zero::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<seg_queue::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::send_and_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::reuse::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::sync_and_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 44 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 44 | where | 412 | 44 | F: FnOnce(&Scope<'env>) -> T, | 413 | 44 | F: Send + 'env, | 414 | 44 | T: Send + 'env, | 415 | 44 | { | 416 | 44 | // The result of `f` will be stored here. | 417 | 44 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 44 | let (handle, thread) = { | 421 | 44 | let result = Arc::clone(&result); | 422 | 44 | | 423 | 44 | // A clone of the scope that will be moved into the new thread. | 424 | 44 | let scope = Scope::<'env> { | 425 | 44 | handles: Arc::clone(&self.scope.handles), | 426 | 44 | wait_group: self.scope.wait_group.clone(), | 427 | 44 | _marker: PhantomData, | 428 | 44 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 44 | let handle = { | 432 | 44 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 44 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 44 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 44 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 44 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 44 | let thread = handle.thread().clone(); | 453 | 44 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 44 | (handle, thread) | 455 | 44 | }; | 456 | 44 | | 457 | 44 | // Add the handle to the shared list of join handles. | 458 | 44 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 44 | | 460 | 44 | Ok(ScopedJoinHandle { | 461 | 44 | handle, | 462 | 44 | result, | 463 | 44 | thread, | 464 | 44 | _marker: PhantomData, | 465 | 44 | }) | 466 | 44 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::loop_try::{closure#0}::{closure#2}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::linearizable_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::matching_with_leftover::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 55 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 55 | where | 412 | 55 | F: FnOnce(&Scope<'env>) -> T, | 413 | 55 | F: Send + 'env, | 414 | 55 | T: Send + 'env, | 415 | 55 | { | 416 | 55 | // The result of `f` will be stored here. | 417 | 55 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 55 | let (handle, thread) = { | 421 | 55 | let result = Arc::clone(&result); | 422 | 55 | | 423 | 55 | // A clone of the scope that will be moved into the new thread. | 424 | 55 | let scope = Scope::<'env> { | 425 | 55 | handles: Arc::clone(&self.scope.handles), | 426 | 55 | wait_group: self.scope.wait_group.clone(), | 427 | 55 | _marker: PhantomData, | 428 | 55 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 55 | let handle = { | 432 | 55 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 55 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 55 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 55 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 55 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 55 | let thread = handle.thread().clone(); | 453 | 55 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 55 | (handle, thread) | 455 | 55 | }; | 456 | 55 | | 457 | 55 | // Add the handle to the shared list of join handles. | 458 | 55 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 55 | | 460 | 55 | Ok(ScopedJoinHandle { | 461 | 55 | handle, | 462 | 55 | result, | 463 | 55 | thread, | 464 | 55 | _marker: PhantomData, | 465 | 55 | }) | 466 | 55 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::recv_two::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::ready::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::stress_clone::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<after::select::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::nested_recv_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_iter_break::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<iter::recv_try_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
Unexecuted instantiation: <crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread_locals::use_while_exiting::{closure#0}::{closure#1}, ()>Unexecuted instantiation: <crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread_locals::use_while_exiting::{closure#0}::{closure#0}, ()><crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::recv_two::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::select::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<tick::ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::len::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<array_queue::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<subcrates::utils::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<fifo::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#1}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::mpmc::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::drops::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 100 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 100 | where | 412 | 100 | F: FnOnce(&Scope<'env>) -> T, | 413 | 100 | F: Send + 'env, | 414 | 100 | T: Send + 'env, | 415 | 100 | { | 416 | 100 | // The result of `f` will be stored here. | 417 | 100 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 100 | let (handle, thread) = { | 421 | 100 | let result = Arc::clone(&result); | 422 | 100 | | 423 | 100 | // A clone of the scope that will be moved into the new thread. | 424 | 100 | let scope = Scope::<'env> { | 425 | 100 | handles: Arc::clone(&self.scope.handles), | 426 | 100 | wait_group: self.scope.wait_group.clone(), | 427 | 100 | _marker: PhantomData, | 428 | 100 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 100 | let handle = { | 432 | 100 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 100 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 100 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 100 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 100 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 100 | let thread = handle.thread().clone(); | 453 | 100 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 100 | (handle, thread) | 455 | 100 | }; | 456 | 100 | | 457 | 100 | // Add the handle to the shared list of join handles. | 458 | 100 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 100 | | 460 | 100 | Ok(ScopedJoinHandle { | 461 | 100 | handle, | 462 | 100 | result, | 463 | 100 | thread, | 464 | 100 | _marker: PhantomData, | 465 | 100 | }) | 466 | 100 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_iter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::spsc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::stress_oneshot::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 10.0k | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10.0k | where | 412 | 10.0k | F: FnOnce(&Scope<'env>) -> T, | 413 | 10.0k | F: Send + 'env, | 414 | 10.0k | T: Send + 'env, | 415 | 10.0k | { | 416 | 10.0k | // The result of `f` will be stored here. | 417 | 10.0k | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10.0k | let (handle, thread) = { | 421 | 10.0k | let result = Arc::clone(&result); | 422 | 10.0k | | 423 | 10.0k | // A clone of the scope that will be moved into the new thread. | 424 | 10.0k | let scope = Scope::<'env> { | 425 | 10.0k | handles: Arc::clone(&self.scope.handles), | 426 | 10.0k | wait_group: self.scope.wait_group.clone(), | 427 | 10.0k | _marker: PhantomData, | 428 | 10.0k | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10.0k | let handle = { | 432 | 10.0k | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10.0k | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10.0k | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10.0k | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10.0k | let thread = handle.thread().clone(); | 453 | 10.0k | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10.0k | (handle, thread) | 455 | 10.0k | }; | 456 | 10.0k | | 457 | 10.0k | // Add the handle to the shared list of join handles. | 458 | 10.0k | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10.0k | | 460 | 10.0k | Ok(ScopedJoinHandle { | 461 | 10.0k | handle, | 462 | 10.0k | result, | 463 | 10.0k | thread, | 464 | 10.0k | _marker: PhantomData, | 465 | 10.0k | }) | 466 | 10.0k | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::linearizable::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 4 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 4 | where | 412 | 4 | F: FnOnce(&Scope<'env>) -> T, | 413 | 4 | F: Send + 'env, | 414 | 4 | T: Send + 'env, | 415 | 4 | { | 416 | 4 | // The result of `f` will be stored here. | 417 | 4 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 4 | let (handle, thread) = { | 421 | 4 | let result = Arc::clone(&result); | 422 | 4 | | 423 | 4 | // A clone of the scope that will be moved into the new thread. | 424 | 4 | let scope = Scope::<'env> { | 425 | 4 | handles: Arc::clone(&self.scope.handles), | 426 | 4 | wait_group: self.scope.wait_group.clone(), | 427 | 4 | _marker: PhantomData, | 428 | 4 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 4 | let handle = { | 432 | 4 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 4 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 4 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 4 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 4 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 4 | let thread = handle.thread().clone(); | 453 | 4 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 4 | (handle, thread) | 455 | 4 | }; | 456 | 4 | | 457 | 4 | // Add the handle to the shared list of join handles. | 458 | 4 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 4 | | 460 | 4 | Ok(ScopedJoinHandle { | 461 | 4 | handle, | 462 | 4 | result, | 463 | 4 | thread, | 464 | 4 | _marker: PhantomData, | 465 | 4 | }) | 466 | 4 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<list::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 44 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 44 | where | 412 | 44 | F: FnOnce(&Scope<'env>) -> T, | 413 | 44 | F: Send + 'env, | 414 | 44 | T: Send + 'env, | 415 | 44 | { | 416 | 44 | // The result of `f` will be stored here. | 417 | 44 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 44 | let (handle, thread) = { | 421 | 44 | let result = Arc::clone(&result); | 422 | 44 | | 423 | 44 | // A clone of the scope that will be moved into the new thread. | 424 | 44 | let scope = Scope::<'env> { | 425 | 44 | handles: Arc::clone(&self.scope.handles), | 426 | 44 | wait_group: self.scope.wait_group.clone(), | 427 | 44 | _marker: PhantomData, | 428 | 44 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 44 | let handle = { | 432 | 44 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 44 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 44 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 44 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 44 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 44 | let thread = handle.thread().clone(); | 453 | 44 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 44 | (handle, thread) | 455 | 44 | }; | 456 | 44 | | 457 | 44 | // Add the handle to the shared list of join handles. | 458 | 44 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 44 | | 460 | 44 | Ok(ScopedJoinHandle { | 461 | 44 | handle, | 462 | 44 | result, | 463 | 44 | thread, | 464 | 44 | _marker: PhantomData, | 465 | 44 | }) | 466 | 44 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::send_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_sender::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnect_wakes_receiver::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::try_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::loop_try::{closure#0}::{closure#2}, ()>Line | Count | Source | 410 | 20 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 20 | where | 412 | 20 | F: FnOnce(&Scope<'env>) -> T, | 413 | 20 | F: Send + 'env, | 414 | 20 | T: Send + 'env, | 415 | 20 | { | 416 | 20 | // The result of `f` will be stored here. | 417 | 20 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 20 | let (handle, thread) = { | 421 | 20 | let result = Arc::clone(&result); | 422 | 20 | | 423 | 20 | // A clone of the scope that will be moved into the new thread. | 424 | 20 | let scope = Scope::<'env> { | 425 | 20 | handles: Arc::clone(&self.scope.handles), | 426 | 20 | wait_group: self.scope.wait_group.clone(), | 427 | 20 | _marker: PhantomData, | 428 | 20 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 20 | let handle = { | 432 | 20 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 20 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 20 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 20 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 20 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 20 | let thread = handle.thread().clone(); | 453 | 20 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 20 | (handle, thread) | 455 | 20 | }; | 456 | 20 | | 457 | 20 | // Add the handle to the shared list of join handles. | 458 | 20 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 20 | | 460 | 20 | Ok(ScopedJoinHandle { | 461 | 20 | handle, | 462 | 20 | result, | 463 | 20 | thread, | 464 | 20 | _marker: PhantomData, | 465 | 20 | }) | 466 | 20 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_default::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::matching_with_leftover::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 55 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 55 | where | 412 | 55 | F: FnOnce(&Scope<'env>) -> T, | 413 | 55 | F: Send + 'env, | 414 | 55 | T: Send + 'env, | 415 | 55 | { | 416 | 55 | // The result of `f` will be stored here. | 417 | 55 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 55 | let (handle, thread) = { | 421 | 55 | let result = Arc::clone(&result); | 422 | 55 | | 423 | 55 | // A clone of the scope that will be moved into the new thread. | 424 | 55 | let scope = Scope::<'env> { | 425 | 55 | handles: Arc::clone(&self.scope.handles), | 426 | 55 | wait_group: self.scope.wait_group.clone(), | 427 | 55 | _marker: PhantomData, | 428 | 55 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 55 | let handle = { | 432 | 55 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 55 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 55 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 55 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 55 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 55 | let thread = handle.thread().clone(); | 453 | 55 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 55 | (handle, thread) | 455 | 55 | }; | 456 | 55 | | 457 | 55 | // Add the handle to the shared list of join handles. | 458 | 55 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 55 | | 460 | 55 | Ok(ScopedJoinHandle { | 461 | 55 | handle, | 462 | 55 | result, | 463 | 55 | thread, | 464 | 55 | _marker: PhantomData, | 465 | 55 | }) | 466 | 55 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::linearizable_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::recv_timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<select_macro::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::both_ready::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_mixed::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::cloning1::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_timeout_two_threads::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::disconnected::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_recv::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::channel_through_channel::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::timeout::{closure#1}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::stress_send::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::unblocks::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<ready::fairness2::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<parker::park_timeout_unpark_called_other_thread::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 10 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10 | where | 412 | 10 | F: FnOnce(&Scope<'env>) -> T, | 413 | 10 | F: Send + 'env, | 414 | 10 | T: Send + 'env, | 415 | 10 | { | 416 | 10 | // The result of `f` will be stored here. | 417 | 10 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10 | let (handle, thread) = { | 421 | 10 | let result = Arc::clone(&result); | 422 | 10 | | 423 | 10 | // A clone of the scope that will be moved into the new thread. | 424 | 10 | let scope = Scope::<'env> { | 425 | 10 | handles: Arc::clone(&self.scope.handles), | 426 | 10 | wait_group: self.scope.wait_group.clone(), | 427 | 10 | _marker: PhantomData, | 428 | 10 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10 | let handle = { | 432 | 10 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10 | let thread = handle.thread().clone(); | 453 | 10 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10 | (handle, thread) | 455 | 10 | }; | 456 | 10 | | 457 | 10 | // Add the handle to the shared list of join handles. | 458 | 10 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10 | | 460 | 10 | Ok(ScopedJoinHandle { | 461 | 10 | handle, | 462 | 10 | result, | 463 | 10 | thread, | 464 | 10 | _marker: PhantomData, | 465 | 10 | }) | 466 | 10 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::no_starvation::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stampede::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::destructors::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<lifo::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<<thread::nesting::Wrapper>::recurse::{closure#0}, ()>Line | Count | Source | 410 | 5 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 5 | where | 412 | 5 | F: FnOnce(&Scope<'env>) -> T, | 413 | 5 | F: Send + 'env, | 414 | 5 | T: Send + 'env, | 415 | 5 | { | 416 | 5 | // The result of `f` will be stored here. | 417 | 5 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 5 | let (handle, thread) = { | 421 | 5 | let result = Arc::clone(&result); | 422 | 5 | | 423 | 5 | // A clone of the scope that will be moved into the new thread. | 424 | 5 | let scope = Scope::<'env> { | 425 | 5 | handles: Arc::clone(&self.scope.handles), | 426 | 5 | wait_group: self.scope.wait_group.clone(), | 427 | 5 | _marker: PhantomData, | 428 | 5 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 5 | let handle = { | 432 | 5 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 5 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 5 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 5 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 5 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 5 | let thread = handle.thread().clone(); | 453 | 5 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 5 | (handle, thread) | 455 | 5 | }; | 456 | 5 | | 457 | 5 | // Add the handle to the shared list of join handles. | 458 | 5 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 5 | | 460 | 5 | Ok(ScopedJoinHandle { | 461 | 5 | handle, | 462 | 5 | result, | 463 | 5 | thread, | 464 | 5 | _marker: PhantomData, | 465 | 5 | }) | 466 | 5 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#2}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::scope_returns_ok::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_builder::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 10 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10 | where | 412 | 10 | F: FnOnce(&Scope<'env>) -> T, | 413 | 10 | F: Send + 'env, | 414 | 10 | T: Send + 'env, | 415 | 10 | { | 416 | 10 | // The result of `f` will be stored here. | 417 | 10 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10 | let (handle, thread) = { | 421 | 10 | let result = Arc::clone(&result); | 422 | 10 | | 423 | 10 | // A clone of the scope that will be moved into the new thread. | 424 | 10 | let scope = Scope::<'env> { | 425 | 10 | handles: Arc::clone(&self.scope.handles), | 426 | 10 | wait_group: self.scope.wait_group.clone(), | 427 | 10 | _marker: PhantomData, | 428 | 10 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10 | let handle = { | 432 | 10 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10 | let thread = handle.thread().clone(); | 453 | 10 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10 | (handle, thread) | 455 | 10 | }; | 456 | 10 | | 457 | 10 | // Add the handle to the shared list of join handles. | 458 | 10 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10 | | 460 | 10 | Ok(ScopedJoinHandle { | 461 | 10 | handle, | 462 | 10 | result, | 463 | 10 | thread, | 464 | 10 | _marker: PhantomData, | 465 | 10 | }) | 466 | 10 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 10 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10 | where | 412 | 10 | F: FnOnce(&Scope<'env>) -> T, | 413 | 10 | F: Send + 'env, | 414 | 10 | T: Send + 'env, | 415 | 10 | { | 416 | 10 | // The result of `f` will be stored here. | 417 | 10 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10 | let (handle, thread) = { | 421 | 10 | let result = Arc::clone(&result); | 422 | 10 | | 423 | 10 | // A clone of the scope that will be moved into the new thread. | 424 | 10 | let scope = Scope::<'env> { | 425 | 10 | handles: Arc::clone(&self.scope.handles), | 426 | 10 | wait_group: self.scope.wait_group.clone(), | 427 | 10 | _marker: PhantomData, | 428 | 10 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10 | let handle = { | 432 | 10 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10 | let thread = handle.thread().clone(); | 453 | 10 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10 | (handle, thread) | 455 | 10 | }; | 456 | 10 | | 457 | 10 | // Add the handle to the shared list of join handles. | 458 | 10 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10 | | 460 | 10 | Ok(ScopedJoinHandle { | 461 | 10 | handle, | 462 | 10 | result, | 463 | 10 | thread, | 464 | 10 | _marker: PhantomData, | 465 | 10 | }) | 466 | 10 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::counter_panic::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 10 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 10 | where | 412 | 10 | F: FnOnce(&Scope<'env>) -> T, | 413 | 10 | F: Send + 'env, | 414 | 10 | T: Send + 'env, | 415 | 10 | { | 416 | 10 | // The result of `f` will be stored here. | 417 | 10 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 10 | let (handle, thread) = { | 421 | 10 | let result = Arc::clone(&result); | 422 | 10 | | 423 | 10 | // A clone of the scope that will be moved into the new thread. | 424 | 10 | let scope = Scope::<'env> { | 425 | 10 | handles: Arc::clone(&self.scope.handles), | 426 | 10 | wait_group: self.scope.wait_group.clone(), | 427 | 10 | _marker: PhantomData, | 428 | 10 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 10 | let handle = { | 432 | 10 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 10 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 10 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 10 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 10 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 10 | let thread = handle.thread().clone(); | 453 | 10 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 10 | (handle, thread) | 455 | 10 | }; | 456 | 10 | | 457 | 10 | // Add the handle to the shared list of join handles. | 458 | 10 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 10 | | 460 | 10 | Ok(ScopedJoinHandle { | 461 | 10 | handle, | 462 | 10 | result, | 463 | 10 | thread, | 464 | 10 | _marker: PhantomData, | 465 | 10 | }) | 466 | 10 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::as_pthread_t::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::nesting::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::join_nested::{closure#0}::{closure#0}::{closure#0}, i32>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_many::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<thread::panic_twice::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::stress::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 3 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 3 | where | 412 | 3 | F: FnOnce(&Scope<'env>) -> T, | 413 | 3 | F: Send + 'env, | 414 | 3 | T: Send + 'env, | 415 | 3 | { | 416 | 3 | // The result of `f` will be stored here. | 417 | 3 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 3 | let (handle, thread) = { | 421 | 3 | let result = Arc::clone(&result); | 422 | 3 | | 423 | 3 | // A clone of the scope that will be moved into the new thread. | 424 | 3 | let scope = Scope::<'env> { | 425 | 3 | handles: Arc::clone(&self.scope.handles), | 426 | 3 | wait_group: self.scope.wait_group.clone(), | 427 | 3 | _marker: PhantomData, | 428 | 3 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 3 | let handle = { | 432 | 3 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 3 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 3 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 3 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 3 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 3 | let thread = handle.thread().clone(); | 453 | 3 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 3 | (handle, thread) | 455 | 3 | }; | 456 | 3 | | 457 | 3 | // Add the handle to the shared list of join handles. | 458 | 3 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 3 | | 460 | 3 | Ok(ScopedJoinHandle { | 461 | 3 | handle, | 462 | 3 | result, | 463 | 3 | thread, | 464 | 3 | _marker: PhantomData, | 465 | 3 | }) | 466 | 3 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::default::tests::pin_while_exiting::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::collector::tests::pin_holds_advance::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#2}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::iter_multi::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spmc::{closure#0}::{closure#1}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::list::tests::insert_delete_multi::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 8 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 8 | where | 412 | 8 | F: FnOnce(&Scope<'env>) -> T, | 413 | 8 | F: Send + 'env, | 414 | 8 | T: Send + 'env, | 415 | 8 | { | 416 | 8 | // The result of `f` will be stored here. | 417 | 8 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 8 | let (handle, thread) = { | 421 | 8 | let result = Arc::clone(&result); | 422 | 8 | | 423 | 8 | // A clone of the scope that will be moved into the new thread. | 424 | 8 | let scope = Scope::<'env> { | 425 | 8 | handles: Arc::clone(&self.scope.handles), | 426 | 8 | wait_group: self.scope.wait_group.clone(), | 427 | 8 | _marker: PhantomData, | 428 | 8 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 8 | let handle = { | 432 | 8 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 8 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 8 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 8 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 8 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 8 | let thread = handle.thread().clone(); | 453 | 8 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 8 | (handle, thread) | 455 | 8 | }; | 456 | 8 | | 457 | 8 | // Add the handle to the shared list of join handles. | 458 | 8 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 8 | | 460 | 8 | Ok(ScopedJoinHandle { | 461 | 8 | handle, | 462 | 8 | result, | 463 | 8 | thread, | 464 | 8 | _marker: PhantomData, | 465 | 8 | }) | 466 | 8 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_pop_many_spsc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 1 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 1 | where | 412 | 1 | F: FnOnce(&Scope<'env>) -> T, | 413 | 1 | F: Send + 'env, | 414 | 1 | T: Send + 'env, | 415 | 1 | { | 416 | 1 | // The result of `f` will be stored here. | 417 | 1 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 1 | let (handle, thread) = { | 421 | 1 | let result = Arc::clone(&result); | 422 | 1 | | 423 | 1 | // A clone of the scope that will be moved into the new thread. | 424 | 1 | let scope = Scope::<'env> { | 425 | 1 | handles: Arc::clone(&self.scope.handles), | 426 | 1 | wait_group: self.scope.wait_group.clone(), | 427 | 1 | _marker: PhantomData, | 428 | 1 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 1 | let handle = { | 432 | 1 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 1 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 1 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 1 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 1 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 1 | let thread = handle.thread().clone(); | 453 | 1 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 1 | (handle, thread) | 455 | 1 | }; | 456 | 1 | | 457 | 1 | // Add the handle to the shared list of join handles. | 458 | 1 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 1 | | 460 | 1 | Ok(ScopedJoinHandle { | 461 | 1 | handle, | 462 | 1 | result, | 463 | 1 | thread, | 464 | 1 | _marker: PhantomData, | 465 | 1 | }) | 466 | 1 | } |
<crossbeam_utils::thread::ScopedThreadBuilder>::spawn::<crossbeam_epoch::sync::queue::test::push_try_pop_many_mpmc::{closure#0}::{closure#0}, ()>Line | Count | Source | 410 | 2 | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>> | 411 | 2 | where | 412 | 2 | F: FnOnce(&Scope<'env>) -> T, | 413 | 2 | F: Send + 'env, | 414 | 2 | T: Send + 'env, | 415 | 2 | { | 416 | 2 | // The result of `f` will be stored here. | 417 | 2 | let result = SharedOption::default(); | 418 | | | 419 | | // Spawn the thread and grab its join handle and thread handle. | 420 | 2 | let (handle, thread) = { | 421 | 2 | let result = Arc::clone(&result); | 422 | 2 | | 423 | 2 | // A clone of the scope that will be moved into the new thread. | 424 | 2 | let scope = Scope::<'env> { | 425 | 2 | handles: Arc::clone(&self.scope.handles), | 426 | 2 | wait_group: self.scope.wait_group.clone(), | 427 | 2 | _marker: PhantomData, | 428 | 2 | }; | 429 | | | 430 | | // Spawn the thread. | 431 | 2 | let handle = { | 432 | 2 | let closure = move || { | 433 | | // Make sure the scope is inside the closure with the proper `'env` lifetime. | 434 | | let scope: Scope<'env> = scope; | 435 | | | 436 | | // Run the closure. | 437 | | let res = f(&scope); | 438 | | | 439 | | // Store the result if the closure didn't panic. | 440 | | *result.lock().unwrap() = Some(res); | 441 | | }; | 442 | | | 443 | | // Allocate `closure` on the heap and erase the `'env` bound. | 444 | 2 | let closure: Box<dyn FnOnce() + Send + 'env> = Box::new(closure); | 445 | 2 | let closure: Box<dyn FnOnce() + Send + 'static> = | 446 | 2 | unsafe { mem::transmute(closure) }; | 447 | | | 448 | | // Finally, spawn the closure. | 449 | 2 | self.builder.spawn(move || closure())?0 | 450 | | }; | 451 | | | 452 | 2 | let thread = handle.thread().clone(); | 453 | 2 | let handle = Arc::new(Mutex::new(Some(handle))); | 454 | 2 | (handle, thread) | 455 | 2 | }; | 456 | 2 | | 457 | 2 | // Add the handle to the shared list of join handles. | 458 | 2 | self.scope.handles.lock().unwrap().push(Arc::clone(&handle)); | 459 | 2 | | 460 | 2 | Ok(ScopedJoinHandle { | 461 | 2 | handle, | 462 | 2 | result, | 463 | 2 | thread, | 464 | 2 | _marker: PhantomData, | 465 | 2 | }) | 466 | 2 | } |
|
467 | | } |
468 | | |
469 | | unsafe impl<T> Send for ScopedJoinHandle<'_, T> {} |
470 | | unsafe impl<T> Sync for ScopedJoinHandle<'_, T> {} |
471 | | |
472 | | /// A handle that can be used to join its scoped thread. |
473 | | /// |
474 | | /// This struct is created by the [`Scope::spawn`] method and the |
475 | | /// [`ScopedThreadBuilder::spawn`] method. |
476 | | pub struct ScopedJoinHandle<'scope, T> { |
477 | | /// A join handle to the spawned thread. |
478 | | handle: SharedOption<thread::JoinHandle<()>>, |
479 | | |
480 | | /// Holds the result of the inner closure. |
481 | | result: SharedOption<T>, |
482 | | |
483 | | /// A handle to the the spawned thread. |
484 | | thread: thread::Thread, |
485 | | |
486 | | /// Borrows the parent scope with lifetime `'scope`. |
487 | | _marker: PhantomData<&'scope ()>, |
488 | | } |
489 | | |
490 | | impl<T> ScopedJoinHandle<'_, T> { |
491 | | /// Waits for the thread to finish and returns its result. |
492 | | /// |
493 | | /// If the child thread panics, an error is returned. |
494 | | /// |
495 | | /// # Panics |
496 | | /// |
497 | | /// This function may panic on some platforms if a thread attempts to join itself or otherwise |
498 | | /// may create a deadlock with joining threads. |
499 | | /// |
500 | | /// # Examples |
501 | | /// |
502 | | /// ``` |
503 | | /// use crossbeam_utils::thread; |
504 | | /// |
505 | | /// thread::scope(|s| { |
506 | | /// let handle1 = s.spawn(|_| println!("I'm a happy thread :)")); |
507 | | /// let handle2 = s.spawn(|_| panic!("I'm a sad thread :(")); |
508 | | /// |
509 | | /// // Join the first thread and verify that it succeeded. |
510 | | /// let res = handle1.join(); |
511 | | /// assert!(res.is_ok()); |
512 | | /// |
513 | | /// // Join the second thread and verify that it panicked. |
514 | | /// let res = handle2.join(); |
515 | | /// assert!(res.is_err()); |
516 | | /// }).unwrap(); |
517 | | /// ``` |
518 | 5 | pub fn join(self) -> thread::Result<T> { |
519 | 5 | // Take out the handle. The handle will surely be available because the root scope waits |
520 | 5 | // for nested scopes before joining remaining threads. |
521 | 5 | let handle = self.handle.lock().unwrap().take().unwrap(); |
522 | 5 | |
523 | 5 | // Join the thread and then take the result out of its inner closure. |
524 | 5 | handle |
525 | 5 | .join() |
526 | 5 | .map(|()| self.result.lock().unwrap().take().unwrap()4 ) <crossbeam_utils::thread::ScopedJoinHandle<i32>>::join::{closure#0}Line | Count | Source | 526 | 3 | .map(|()| self.result.lock().unwrap().take().unwrap()) |
<crossbeam_utils::thread::ScopedJoinHandle<()>>::join::{closure#0}Line | Count | Source | 526 | 1 | .map(|()| self.result.lock().unwrap().take().unwrap()) |
|
527 | 5 | } <crossbeam_utils::thread::ScopedJoinHandle<i32>>::join Line | Count | Source | 518 | 3 | pub fn join(self) -> thread::Result<T> { | 519 | 3 | // Take out the handle. The handle will surely be available because the root scope waits | 520 | 3 | // for nested scopes before joining remaining threads. | 521 | 3 | let handle = self.handle.lock().unwrap().take().unwrap(); | 522 | 3 | | 523 | 3 | // Join the thread and then take the result out of its inner closure. | 524 | 3 | handle | 525 | 3 | .join() | 526 | 3 | .map(|()| self.result.lock().unwrap().take().unwrap()) | 527 | 3 | } |
<crossbeam_utils::thread::ScopedJoinHandle<()>>::join Line | Count | Source | 518 | 2 | pub fn join(self) -> thread::Result<T> { | 519 | 2 | // Take out the handle. The handle will surely be available because the root scope waits | 520 | 2 | // for nested scopes before joining remaining threads. | 521 | 2 | let handle = self.handle.lock().unwrap().take().unwrap(); | 522 | 2 | | 523 | 2 | // Join the thread and then take the result out of its inner closure. | 524 | 2 | handle | 525 | 2 | .join() | 526 | 2 | .map(|()| self.result.lock().unwrap().take().unwrap()) | 527 | 2 | } |
|
528 | | |
529 | | /// Returns a handle to the underlying thread. |
530 | | /// |
531 | | /// # Examples |
532 | | /// |
533 | | /// ``` |
534 | | /// use crossbeam_utils::thread; |
535 | | /// |
536 | | /// thread::scope(|s| { |
537 | | /// let handle = s.spawn(|_| println!("A child thread is running")); |
538 | | /// println!("The child thread ID: {:?}", handle.thread().id()); |
539 | | /// }).unwrap(); |
540 | | /// ``` |
541 | | pub fn thread(&self) -> &thread::Thread { |
542 | | &self.thread |
543 | | } |
544 | | } |
545 | | |
546 | | cfg_if! { |
547 | | if #[cfg(unix)] { |
548 | | use std::os::unix::thread::{JoinHandleExt, RawPthread}; |
549 | | |
550 | | impl<T> JoinHandleExt for ScopedJoinHandle<'_, T> { |
551 | 1 | fn as_pthread_t(&self) -> RawPthread { |
552 | 1 | // Borrow the handle. The handle will surely be available because the root scope waits |
553 | 1 | // for nested scopes before joining remaining threads. |
554 | 1 | let handle = self.handle.lock().unwrap(); |
555 | 1 | handle.as_ref().unwrap().as_pthread_t() |
556 | 1 | } |
557 | | fn into_pthread_t(self) -> RawPthread { |
558 | | self.as_pthread_t() |
559 | | } |
560 | | } |
561 | | } else if #[cfg(windows)] { |
562 | | use std::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle}; |
563 | | |
564 | | impl<T> AsRawHandle for ScopedJoinHandle<'_, T> { |
565 | | fn as_raw_handle(&self) -> RawHandle { |
566 | | // Borrow the handle. The handle will surely be available because the root scope waits |
567 | | // for nested scopes before joining remaining threads. |
568 | | let handle = self.handle.lock().unwrap(); |
569 | | handle.as_ref().unwrap().as_raw_handle() |
570 | | } |
571 | | } |
572 | | |
573 | | impl<T> IntoRawHandle for ScopedJoinHandle<'_, T> { |
574 | | fn into_raw_handle(self) -> RawHandle { |
575 | | self.as_raw_handle() |
576 | | } |
577 | | } |
578 | | } |
579 | | } |
580 | | |
581 | | impl<T> fmt::Debug for ScopedJoinHandle<'_, T> { |
582 | | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
583 | | f.pad("ScopedJoinHandle { .. }") |
584 | | } |
585 | | } |